Bootstrap

gitlab登录报错503

今天gitlab登录报错503,检查gitlab发现gitaly检查失败,报错如下:

Failed to connect to Gitaly…

Error: 14:Connect Failed

重启gitlab,报错gitaly启动失败:

timeout: run: gitaly: (pid 6657) 4540s, got TERM

在gitlab社区中查看相关问题,大部分都是删除gitaly.pid然后重启解决,但是相关问题的gitaly.pid都是空的,但是我的gitaly.pid不为空,按照这种解决方案无法成功。

查看gitaly的日志,

2019-10-08_02:39:25.93975 time=“2019-10-08T02:39:25Z” level=warning msg=“forwarding signal” gitaly=6732 signal=terminated wrapper=6657

发现问题的关键是前后gitaly.pid不符合导致,之前的删除gitaly.pid方式也是解决pid冲突,因此根本的解决方法就是解决gitaly的pid冲突。

1、关闭gitlab的所有服务,你会发现无法关闭gitaly

关闭gitlab

2、单独关闭gitaly服务

ps -ef | grep gitaly

root 3315 12795 0 10:43 pts/0 00:00:00 grep --color=auto gitaly

root 6623 6619 0 09:18 ? 00:00:00 runsv gitaly

root 6655 6623 31 09:18 ? 00:26:41 svlogd -tt /var/log/gitlab/gitaly

git 6657 6623 99 09:18 ? 01:31:16 /opt/gitlab/embedded/bin/gitaly-wrapper /opt/gitlab/embedded/bin/gitaly /var/opt/gitlab/gitaly/config.toml

kill -9 6623 6657

3、删除gitaly.pid ,这次不需要关心gitaly.pid是否为空

gitaly.pid 默认地址 /var/opt/gitlab/gitaly/gitaly.pid

4、启动gitlab

gitlab-ctl start

启动成功,问题解决
引自 链接:https://www.jianshu.com/p/64cc434f6ebd

;