一、访问gitlab登录页面报500错误
1. 查看tail -f /var/log/gitlab/gitlab-rails/production.log有以下报错
NoMethodError (undefined method `login_recaptcha_protection_enabled' for #<ApplicationSetting:0x00007fdc026a3f70>
Did you mean? recaptcha_or_login_protection_enabled):
2. 查看服务运行情况,全部正常
[root@gitlab ~]# gitlab-ctl status
run: alertmanager: (pid 5120) 32885s; run: log: (pid 3362) 33748s
run: gitaly: (pid 5130) 32884s; run: log: (pid 2767) 33850s
run: gitlab-monitor: (pid 5149) 32884s; run: log: (pid 3273) 33766s
run: gitlab-workhorse: (pid 5157) 32883s; run: log: (pid 3086) 33791s
run: grafana: (pid 5170) 32883s; run: log: (pid 3486) 33712s
run: logrotate: (pid 64833) 482s; run: log: (pid 3187) 33778s
run: nginx: (pid 5187) 32882s; run: log: (pid 3128) 33784s
run: node-exporter: (pid 5269) 32882s; run: log: (pid 3248) 33772s
run: postgres-exporter: (pid 5274) 32881s; run: log: (pid 3401) 33743s
run: postgresql: (pid 5280) 32881s; run: log: (pid 2910) 33844s
run: prometheus: (pid 5289) 32880s; run: log: (pid 3330) 33754s
run: redis: (pid 5300) 32880s; run: log: (pid 2714) 33853s
run: redis-exporter: (pid 5304) 32879s; run: log: (pid 3299) 33760s
run: sidekiq: (pid 5310) 32879s; run: log: (pid 3059) 33796s
run: unicorn: (pid 5316) 32879s; run: log: (pid 3042) 33802s
3. 查看数据库状态,发现有两个处于down状态(ps:GitLab发现报500错误,大部分因为DB数据关系错误,需要升级数据库关系)
[root@gitlab ~]# gitlab-rake db:migrate:status
down 20190719122333 Add login recaptcha protection enabled to application settings
down 20190816151221 Add active jobs limit to plans
#第一个的作用:向应用程序设置中添加已启用的登录recaptcha保护
#第二个的作用:将活动工作限制添加到计划中
注意:这里数据库出现这种情况的原因是gitlab汉化导致的
4. 更新数据库关系
[root@gitlab ~]# gitlab-rake db:migrate
浏览器访问登录页面(gitlab.xiaoyu.com)