“Linux GitLab 错误”涵盖的范围很广,不同错误有不同的修复方式。下面我按常见场景给你一个排查与修复指南,你可以对照自己的情况处理;如果方便,也可以把具体报错信息发给我,我可以直接定位。
在修复前,请先确认:
# GitLab 版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
# 系统日志
sudo gitlab-ctl tail
# 服务状态
sudo gitlab-ctl status
# 配置检查
sudo gitlab-rake gitlab:check
现象
gitlab-ctl status 显示很多 down修复
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
如果仍不行:
sudo gitlab-ctl tail unicorn
sudo gitlab-ctl tail puma
现象
address already in use修复 修改配置:
sudo vim /etc/gitlab/gitlab.rb
示例:
external_url 'http://gitlab.example.com'
nginx['listen_port'] = 8081
然后:
sudo gitlab-ctl reconfigure
现象
gitlab-rake gitlab:check 报 DB 错误修复
sudo gitlab-ctl restart postgresql
sudo gitlab-rake db:migrate
现象
No space left on device修复
df -h
du -sh /var/opt/gitlab/*
清理:
/var/opt/gitlab/backups现象
git push 被拒修复
sudo chown -R git:git /var/opt/gitlab/git-data
sudo gitlab-ctl restart
现象
修复
letsencrypt['enable'] = false
或更新证书:
sudo gitlab-ctl renew-le-certs
修复
sudo gitlab-ctl reconfigure
sudo gitlab-rake db:migrate
sudo gitlab-ctl restart
如果不确定错误原因,按这个顺序来:
sudo gitlab-ctl stop
sudo gitlab-ctl reconfigure
sudo gitlab-ctl start
sudo gitlab-rake gitlab:check
你可以直接把下面任一内容发给我:
gitlab-ctl tail 的输出我可以根据具体错误信息给你精确到命令的修复方案。