Gitlab其他用户登录返回500错误解决
Posted wx60c1f94c784b4
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Gitlab其他用户登录返回500错误解决相关的知识,希望对你有一定的参考价值。
问题:
安装Gitlab-ce-12-0-3版本并进行汉化后,创建完Gitlab其他用户,在使用其他用户登陆Gitlab时,一直出现500错误!
查看Gitlab运行状态(无异常)
[root@Gitlab ~]# gitlab-ctl status
run: alertmanager: (pid 1266) 36284s; run: log: (pid 1265) 36284s
run: gitaly: (pid 1240) 36284s; run: log: (pid 1239) 36284s
run: gitlab-monitor: (pid 1252) 36284s; run: log: (pid 1251) 36284s
run: gitlab-workhorse: (pid 1254) 36284s; run: log: (pid 1253) 36284s
run: grafana: (pid 1264) 36284s; run: log: (pid 1263) 36284s
run: logrotate: (pid 1256) 36284s; run: log: (pid 1255) 36284s
run: nginx: (pid 1258) 36284s; run: log: (pid 1257) 36284s
run: node-exporter: (pid 1250) 36284s; run: log: (pid 1249) 36284s
run: postgres-exporter: (pid 1268) 36284s; run: log: (pid 1267) 36284s
run: postgresql: (pid 1238) 36284s; run: log: (pid 1237) 36284s
run: redis: (pid 1228) 36284s; run: log: (pid 1227) 36284s
run: redis-exporter: (pid 1260) 36284s; run: log: (pid 1259) 36284s
run: sidekiq: (pid 1247) 36284s; run: log: (pid 1245) 36284s
run: unicorn: (pid 1248) 36284s; run: log: (pid 1246) 36284s
登录异常现象:
原因:
查阅资料得知,GitLab报500错误,可能为DB数据关系错误,需要升级数据库关系。
查看数据库状态
[root@Gitlab ~]# gitlab-rake db:migrate:status
database: gitlabhq_production
Status Migration ID Migration Name
--------------------------------------------------
up 20140313092127 Init schema
up 20140407135544 Fix namespaces
up 20140414131055 Change state to allow empty merge request diffs
up 20140415124820 Limits to mysql
up 20140416074002 Add index on iid
up 20140416185734 Index on current sign in at
up 20140428105831 Add notes index updated at
up 20140502115131 Add repo size to db
up 20140502125220 Migrate repo size
up 20140611135229 Add position to merge request
up 20140625115202 Create users star projects
up 20140729134820 Create labels
up 20140729140420 Create label links
up 20140729145339 Migrate project tags
up 20140729152420 Migrate taggable labels
up 20140730111702 Add index to labels
up 20140903115954 Migrate to new shell
up 20140907220153 Serialize service properties
up 20140914113604 Add members table
up 20140914145549 Migrate to new members model
up 20140914173417 Remove old member tables
up 20141006143943 Move slack service to webhook
...
...
up 20190607190856 Add index to users public emails
up 20190610142825 Add index to members invite email
up 20190611161641 Add target project id to merge trains
up 20190611161642 Add index to events and audit events created at author
up 20190613030606 Enable hashed storage by default
**---发现有2个down---**
down 20190719122333 Add login recaptcha protection enabled to application settings
down 20190816151221 Add active jobs limit to plans
解决方法:
执行下面命令,升级数据库关系
gitlab-rake db:migrate
gitlab-ctl reconfigure
gitlab-ctl restart
[root@Gitlab ~]# gitlab-rake db:migrate
== 20190219201635 AddAssetProxySettings: migrating ============================
-- add_column(:application_settings, :asset_proxy_enabled, :boolean, :default=>false, :null=>false)
-> 0.1534s
-- add_column(:application_settings, :asset_proxy_url, :string)
-> 0.0006s
-- add_column(:application_settings, :asset_proxy_whitelist, :text)
-> 0.0005s
-- add_column(:application_settings, :encrypted_asset_proxy_secret_key, :text)
-> 0.0004s
-- add_column(:application_settings, :encrypted_asset_proxy_secret_key_iv, :string)
-> 0.0004s
== 20190219201635 AddAssetProxySettings: migrated (0.1588s) ===================
== 20190719122333 AddLoginRecaptchaProtectionEnabledToApplicationSettings: migrating
-- add_column(:application_settings, :login_recaptcha_protection_enabled, :boolean, :default=>false, :null=>false)
-> 0.0122s
== 20190719122333 AddLoginRecaptchaProtectionEnabledToApplicationSettings: migrated (0.0123s)
== 20190816151221 AddActiveJobsLimitToPlans: migrating ========================
-- transaction_open?()
-> 0.0000s
-- execute("SET statement_timeout TO 0")
-> 0.0003s
-- transaction()
-- add_column(:plans, :active_jobs_limit, :integer, :default=>nil)
-> 0.0014s
-- change_column_default(:plans, :active_jobs_limit, 0)
-> 0.0014s
-> 0.0035s
-- transaction_open?()
-> 0.0000s
-- exec_query("SELECT COUNT(*) AS count FROM \\"plans\\"")
-> 0.0112s
-- change_column_null(:plans, :active_jobs_limit, false)
-> 0.0014s
-- execute("RESET ALL")
-> 0.0004s
== 20190816151221 AddActiveJobsLimitToPlans: migrated (0.0171s) ===============
[root@Gitlab ~]# gitlab-ctl reconfigure
[root@Gitlab ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 2479) 1s
ok: run: gitaly: (pid 2490) 1s
ok: run: gitlab-monitor: (pid 2515) 0s
ok: run: gitlab-workhorse: (pid 2518) 1s
ok: run: grafana: (pid 2523) 0s
ok: run: logrotate: (pid 2539) 1s
ok: run: nginx: (pid 2545) 0s
ok: run: node-exporter: (pid 2627) 0s
ok: run: postgres-exporter: (pid 2632) 1s
ok: run: postgresql: (pid 2640) 0s
ok: run: redis: (pid 2651) 1s
ok: run: redis-exporter: (pid 2666) 0s
ok: run: sidekiq: (pid 2675) 1s
ok: run: unicorn: (pid 2694) 0s
[root@Gitlab ~]# gitlab-ctl status
run: alertmanager: (pid 2479) 31s; run: log: (pid 1265) 36570s
run: gitaly: (pid 2490) 30s; run: log: (pid 1239) 36570s
run: gitlab-monitor: (pid 2515) 28s; run: log: (pid 1251) 36570s
run: gitlab-workhorse: (pid 2518) 28s; run: log: (pid 1253) 36570s
run: grafana: (pid 2523) 27s; run: log: (pid 1263) 36570s
run: logrotate: (pid 2539) 27s; run: log: (pid 1255) 36570s
run: nginx: (pid 2545) 26s; run: log: (pid 1257) 36570s
run: node-exporter: (pid 2627) 27s; run: log: (pid 1249) 36571s
run: postgres-exporter: (pid 2632) 27s; run: log: (pid 1267) 36571s
run: postgresql: (pid 2640) 26s; run: log: (pid 1237) 36571s
run: redis: (pid 2651) 26s; run: log: (pid 1227) 36571s
run: redis-exporter: (pid 2666) 25s; run: log: (pid 1259) 36571s
run: sidekiq: (pid 2675) 23s; run: log: (pid 1245) 36571s
run: unicorn: (pid 2694) 17s; run: log: (pid 1246) 36571s
重新测试登陆Gitlab
关闭注册功能
↓↓↓↓↓↓
最近刚申请了个微信公众号,上面也会分享一些运维知识,大家点点发财手关注一波,感谢大家。 【原创公众号】:非著名运维 【福利】:公众号回复 “资料” 送运维自学资料大礼包哦!
以上是关于Gitlab其他用户登录返回500错误解决的主要内容,如果未能解决你的问题,请参考以下文章