【Git】gitlab-ce 11.9.8 迁移后,部分操作服务端响应500

环境

K V
centos 7.4
docker 19.03.5
gitlab-ce gitlab/gitlab-ce 11.9.8-ce.0

在作者修复前的已知服务端响应500的操作

  • CI/DI 菜单
  • Remove Project
  • Outbound requests
  • 其他未知菜单…

方法一

方法一 没有解决我的问题 我执行时提示有语法错误

root@192:/etc/gitlab# gitlab-rails db
psql (9.6.11)
Type "help" for help.
gitlabhq_production=> p = Project.find_by_full_path('deliverGroup/csjmall')                   
gitlabhq_production=> p.variables.each(&:destroy)
gitlabhq_production=> SELECT name, runners_token_encrypted FROM Projects WHERE Name = 'csjmall';

方法二

方法二 没有解决我的问题

注意备份文件后再执行命令

root@192:/etc/gitlab# gitlab-rails db
psql (9.6.11)
Type "help" for help.
gitlabhq_production=> Ci::Runner.all.update_all(token_encrypted: nil)

方法三

方法三 解决了我的遇到问题

上面两种方法尝试均无效后,才建议使用此方法。
方法三会重置相关CI的所有密钥和token,谨慎!

-- 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;

举个栗子:

root@192:/etc/gitlab# gitlab-rails db
psql (9.6.11)
Type "help" for help.
gitlabhq_production=> UPDATE projects SET runners_token = null, runners_token_encrypted = null;                                                                                                                                 
UPDATE 45
gitlabhq_production=> UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
UPDATE 15
gitlabhq_production=>  UPDATE application_settings SET runners_registration_token_encrypted = null;
UPDATE 1
gitlabhq_production=> 

参考

gitlab-ci500错误、删除项目报错500错误的解决方法

git_gitlab基本维护和使用

发布了105 篇原创文章 · 获赞 46 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/AV_woaijava/article/details/104903908