Linux 上 GitLab 登录异常的原因有很多,常见情况可以按现象 → 可能原因 → 排查方法来定位。下面给你一个系统的排查思路。
不同表现对应不同问题:
Invalid credentialssudo gitlab-ctl status
重点看:
nginxunicorn / pumasidekiqpostgresql如果有 down,尝试:
sudo gitlab-ctl restart
看日志:
sudo gitlab-ctl tail
常见于:
检查:
free -h
top
日志:
sudo gitlab-ctl tail nginx
sudo gitlab-ctl tail puma
表现:
检查:
sudo gitlab-ctl pg-status
sudo gitlab-rake gitlab:check
GitLab 有登录失败锁定机制。
查看用户状态:
sudo gitlab-rails console
u = User.find_by_username('yourname')
u.failed_attempts
u.locked_at
解锁:
u.unlock_access!
u.save
检查配置:
sudo vim /etc/gitlab/gitlab.rb
关注:
gitlab_rails['ldap_enabled']omniauth测试 LDAP:
sudo gitlab-rake gitlab:ldap:check
date
timedatectl
建议:
sudo ntpdate pool.ntp.org
检查:
sudo gitlab-ctl tail nginx
sudo gitlab-ctl status
sudo gitlab-ctl tail
sudo gitlab-rake gitlab:check
你可以补充:
我可以直接帮你定位到具体原因和修复命令。