gitlab-runner报错500修复
gitlab备份恢复之后打开runner报错500
报错日志信息
Completed 200 OK in 1261ms (Views: 1.4ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 6128)
Started GET "/admin/runners" for 192.168.3.2 at 2022-09-05 07:25:08 +0000
Processing by Admin::RunnersController#index as HTMLRendered layout layouts/admin.html.haml (Duration: 59.5ms | Allocations: 46227)
Completed 500 Internal Server Error in 124ms (ActiveRecord: 16.1ms | Elasticsearch: 0.0ms | Allocations: 57051)ActionView::Template::Error ():39: 40: .col-sm-641: .bs-callout42: = render partial: 'ci/runner/how_to_setup_runner',43: locals: { registration_token: Gitlab::CurrentSettings.runners_registration_token,44: type: 'shared',45: reset_token_url: reset_registration_token_admin_application_settings_path,lib/gitlab/crypto_helper.rb:28:in `aes256_gcm_decrypt'
app/models/concerns/token_authenticatable_strategies/encryption_helper.rb:18:in `decrypt_token'
app/models/concerns/token_authenticatable_strategies/encrypted.rb:45:in `get_token'
app/models/concerns/token_authenticatable_strategies/base.rb:38:in `ensure_token!'
app/models/concerns/token_authenticatable.rb:48:in `block in add_authentication_token_field'
app/models/application_setting_implementation.rb:365:in `runners_registration_token'
lib/gitlab/current_settings.rb:32:in `method_missing'
app/views/admin/runners/index.html.haml:42
app/controllers/application_controller.rb:128:in `render'
app/controllers/application_controller.rb:487:in `set_current_admin'
解决方案
root@txGitlabServer108:/var/log/gitlab/gitlab-rails# gitlab-rails dbconsole
psql (12.7)
Type "help" for help.gitlabhq_production=> UPDATE projects SET runners_token = null, runners_token_encrypted = null;
UPDATE 247
gitlabhq_production=> UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
UPDATE 91
gitlabhq_production=>
gitlabhq_production=>
gitlabhq_production=> UPDATE application_settings SET runners_registration_token_encrypted = null;
UPDATE 1
gitlabhq_production=> UPDATE application_settings SET encrypted_ci_jwt_signing_key = null;
UPDATE 1
gitlabhq_production=>
gitlabhq_production=> UPDATE ci_runners SET token = null, token_encrypted = null;
UPDATE 0
gitlabhq_production=>
解释
链接Gitlab官方文档
## Clear project tokens
UPDATE projects SET runners_token = null, runners_token_encrypted = null;
## Clear group tokens
UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
## Clear instance tokens
UPDATE application_settings SET runners_registration_token_encrypted = null;
## Clear key used for JWT authentication
## This may break the $CI_JWT_TOKEN job variable:
## https://gitlab.com/gitlab-org/gitlab/-/issues/325965
UPDATE application_settings SET encrypted_ci_jwt_signing_key = null;
## Clear runner tokens
UPDATE ci_runners SET token = null, token_encrypted = null;
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
