gitlab-runner故障

本文介绍了当遇到GitLab Runner页面显示500错误时的三种解决方法:重置应用设置、清理配置和重置CI密钥与token。通过执行特定的命令和操作,可以修复内部服务器错误并确保GitLab Runner的正常运行。
摘要由CSDN通过智能技术生成

故障描述

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服务

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值