故障描述
gitlab runner页面500错误
# 报错信息描述
Completed 500 Internal Server Error in 705ms (ActiveRecord: 154.1ms | Elasticsearch: 0.0ms | Allocations: 939040)
==> /var/log/gitlab/gitlab-rails/production.log <==
ActionView::Template::Error ():
19: .table-section.section-30
20: .table-mobile-header{ role: 'rowheader' }= s_('Runners|Runner')
21: .table-mobile-content
22: = link_to("##{runner.id} (#{runner.short_sha})", admin_runner_path(runner))
23: .gl-text-truncate
24: %span{ title: runner.description, data: { toggle: 'tooltip', container: 'body' } }
25: = runner.description
解决思路:
1(解决办法)、设置重置
gitlab-rake console -e production
ApplicationSetting.first.delete
ApplicationSetting.first
=> nill
2(解决办法)、重置配置
#进入gitlab docker
docker exec -it gitlab /bin/bash
#进入gitlab docker
gitlab-rails dbconsole
#等待几分钟,会进入交互界面,进入后输入如下命令
SELECT * FROM public."ci_group_variables";
SELECT * FROM public."ci_variables";
DELETE FROM ci_group_variables;
DELETE FROM ci_variables;
UPDATE projects SET runners_token = null, runners_token_encrypted = null;
UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
UPDATE application_settings SET runners_registration_token_encrypted = null;
UPDATE application_settings SET encrypted_ci_jwt_signing_key = null;
UPDATE ci_runners SET token = null, token_encrypted = null;
UPDATE ci_builds SET token = null, token_encrypted = null;
TRUNCATE web_hooks CASCADE;
3(解决办法)、重置相关CI的所有密钥和token
gitlab-rails console
irb(main):001:0> Ci::Runner.all.update_all(token_encrypted: nil)
gitlab-rails dbconsole
gitlabhq_production=> UPDATE projects SET runners_token = null, runners_token_encrypted = null;
gitlabhq_production=> UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
gitlabhq_production=> UPDATE application_settings SET runners_registration_token_encrypted = null;
执行完命令后,\q 退出
重启gitlab服务