Gitlab其他用户登录返回500错误解决

古人已用三冬足,年少今开万卷余。这篇文章主要讲述Gitlab其他用户登录返回500错误解决相关的知识,希望能为你提供帮助。


问题:【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

StatusMigration IDMigration Name
--------------------------------------------------
up20140313092127Init schema
up20140407135544Fix namespaces
up20140414131055Change state to allow empty merge request diffs
up20140415124820Limits to mysql
up20140416074002Add index on iid
up20140416185734Index on current sign in at
up20140428105831Add notes index updated at
up20140502115131Add repo size to db
up20140502125220Migrate repo size
up20140611135229Add position to merge request
up20140625115202Create users star projects
up20140729134820Create labels
up20140729140420Create label links
up20140729145339Migrate project tags
up20140729152420Migrate taggable labels
up20140730111702Add index to labels
up20140903115954Migrate to new shell
up20140907220153Serialize service properties
up20140914113604Add members table
up20140914145549Migrate to new members model
up20140914173417Remove old member tables
up20141006143943Move slack service to webhook
...
...
up20190607190856Add index to users public emails
up20190610142825Add index to members invite email
up20190611161641Add target project id to merge trains
up20190611161642Add index to events and audit events created at author
up20190613030606Enable hashed storage by default
**---发现有2个down---**
down20190719122333Add login recaptcha protection enabled to application settings
down20190816151221Add 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


??关闭注册功能??


↓↓↓↓↓↓?最近刚申请了个微信公众号,上面也会分享一些运维知识,大家点点发财手关注一波,感谢大家。 ??【原创公众号】:非著名运维 【福利】:公众号回复 “资料” 送运维自学资料大礼包哦!??






    推荐阅读