宝塔部署 gitlab 报错处理方案 · 物联网平台-威尼斯人最新

thingskit · 2020年09月22日 · 最後由 於 2022年08月19日回覆 · 907 次閱讀

错误 1:gitlab 报错 403 forbidden

原因:是由于 ip 被封禁的原因

打开/etc/gitlab/gitlab.rb

找到 gitlab_rails['rack_attack_git_basic_auth'] 将注释打开

添加 ip_whitelist 白名单列表

gitlab_rails['rack_attack_git_basic_auth'] = {
   'enabled' => true,
   'ip_whitelist' => ["127.0.0.1","xxx.xxx.xxx.xxx"],
   'maxretry' => 300,
   'findtime' => 5,
   'bantime' => 60
 }

澳门人威尼斯3966的解决方案:

执行

gitlab-ctl reconfigure

再次访问 forbidden 提示就不在了

错误 2:宝塔面板点击 gitlab,弹出错误信息

抱歉出错了
traceback (most recent call last):
file "class/flask_sockets.py", line 30, in __call__
handler, values = adapter.match()
file "/www/server/panel/pyenv/lib/python3.7/site-packages/werkzeug/routing.py", line 1945, in match
raise notfound()
werkzeug.exceptions.notfound: 404 not found: the requested url was not found on the server. if you entered the url manually please check your spelling and try again.
during handling of the above exception, another exception occurred:
traceback (most recent call last):
file "class/panelplugin.py", line 1707, in a
plugin_main = __import__(get.name'_main')
file "plugin/gitlab/gitlab_main.py", line 112
except exception,ex:
^
syntaxerror: invalid synta

澳门人威尼斯3966的解决方案:进入 ssh 执行此命令即可

wget-o/www/server/panel/plugin/gitlab/gitlab_main.pyhttp://download.bt.cn/install/plugin/gitlab/gitlab_main.py

问题 3:宝塔 gitlab 重新配置后 nginx 无法启动的解决方法

此问题的原因是宝塔把 gitlab 的 nginx 启动文件名改成了 gitlab-web, 但是运行 gitlab-ctl reconfigure 会把一个配置文件里面的 gitlab-web 还原回 nginx

所以我们只需要改回去就好了。

宝塔后台打开/opt/gitlab/sv/nginx/run

exec chpst -p /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx

改为

exec chpst -p /opt/gitlab/embedded/sbin/gitlab-web -p /var/opt/gitlab/nginx

然后保存退出,运行 gitlab-ctl restart 即可

暫無回覆。
需要 登錄 後方可回應,如果你還沒有帳號按這裡 註冊
网站地图