【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基本維護和使用

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章