プログラムを中心とした個人的なメモ用のブログです。 タイトルは迷走中。
内容の保証はできませんのであしからずご了承ください。

2020/01/10

GitLab の Admin / Runners で 500 エラーが表示される

update2020/01/14 event_note2020/01/09 23:32

GitLab のバックアップとリストアを行った後、管理者メニューの Runners の画面で 500 エラーが表示されるようになりました。

環境

  • GitLab Omnibus(CE) 12.5.6

原因と解決方法

以下の2つのファイルをバックアップ時にコピーして、リストア後に戻してやると解決しました。

  • /etc/gitlab/gitlab-secrets.json
  • /etc/gitlab/gitlab.rb

初期化方法

上記のファイルを取得できない場合、以下の方法で初期化します。
初期化後は再度 gitlab-runner の登録が必要です。

# gitlab-rails dbconsole
psql (10.9)
Type "help" for help.

gitlabhq_production=> -- Clear project tokens
gitlabhq_production=> UPDATE projects SET runners_token = null, runners_token_encrypted = null;
UPDATE 168
gitlabhq_production=> -- Clear group tokens
gitlabhq_production=> UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
UPDATE 46
gitlabhq_production=> -- Clear instance tokens
gitlabhq_production=> UPDATE application_settings SET runners_registration_token_encrypted = null;
UPDATE 5
gitlabhq_production=> -- Clear runner tokens
gitlabhq_production=> UPDATE ci_runners SET token = null, token_encrypted = null;
UPDATE 4