タグ: GitLab

  • GitLab 17.7.2-ceからGitLab 17.10.3へのapt upgradeがエラーになった。

    ちょっと、GitLabのアップデートをサボっていたところ、GitLab 17.7.2-ceからGitLab 17.10.3へのapt upgradeがエラーになった。

    エラーの内容(↓)

    .../gitlab-ce_17.10.3-ce.0_amd64.deb を展開する準備をしています ...
    gitlab preinstall: It seems you are upgrading from 17.7 to 17.10.
    gitlab preinstall: It is required to upgrade to the latest 17.8.x version first before proceeding.
    gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrade-paths
    dpkg: アーカイブ /var/cache/apt/archives/gitlab-ce_17.10.3-ce.0_amd64.deb の処理中にエラーが発生しました (--unpack):
     new gitlab-ce package pre-installation script subprocess returned error exit status 1
    処理中にエラーが発生しました:
     /var/cache/apt/archives/gitlab-ce_17.10.3-ce.0_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    GitLab 17.10.xへのアップデートするために、一度、GitLab 17.8.xに上げる必要があるとのこと。厳密なアップグレードのパスを調べるために、下記の公式サイトで、アップグレードパスをチェックした。

    https://gitlab-com.gitlab.io/support/toolbox/upgrade-path

    これによると、「GitLab 17.8.6」に一度上げる必要があるということで、apt upgradeでバージョン指定をして、実行。コマンドは下記。

    sudo apt upgrade gitlab-ce=17.8.6-ce.0

    GitLab 17.8.6へのアップデートが成功したのを確認して、もう一度、apt update、apt upgradeを行った。

    sudo apt update
    apt list --upgradable
    sudo apt upgrade

    正常終了したらGitlabをリスタートさせて終了。

    sudo gitlab-ctl restart
  • メモ:GitLab 17.3.1-ceから17.4.1-ceはapt updateアップデートできた。

    メモとして。GitLab 17.3.1-ceから17.4.1-ceはapt updateアップデートできた。

  • メモ:GitLab 17.1.1-ceからGitLab 17.3.0-ceへはapt updateでアップデートできた。

    油断すると、GitLab CEのアップデートがapt updateで失敗するので、メモ。

    GitLab 17.1.1-ceからGitLab 17.3.0-ceへはapt updateでアップデートできた。

  • GitLabをaptでアップデートしたらエラー(Gitlab 17.1.0-ce)

    今回のアップグレードは、Gitlab 17.0.1-ce から Gitlab 17.1.0-ce 。アップグレードパスとしては、問題はないはずだったのだが、下記のエラーが出た。

    Running handlers:
    [2024-06-25T18:47:40+09:00] ERROR: Running exception handlers
    There was an error running gitlab-ctl reconfigure:
    
    redis_service[redis] (redis::enable line 19) had an error: RuntimeError: ruby_block[warn pending redis restart] (redis::enable line 88) had an error: RuntimeError: Execution of the command `/opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket INFO` failed with a non-zero exit code (1)
    stdout:
    stderr: Could not connect to Redis at /var/opt/gitlab/redis/redis.socket: No such file or directory
    
    
    
    Running handlers complete
    [2024-06-25T18:47:40+09:00] ERROR: Exception handlers complete
    Infra Phase failed. 11 resources updated in 37 seconds
    [2024-06-25T18:47:40+09:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/cinc-stacktrace.out
    [2024-06-25T18:47:40+09:00] FATAL: ---------------------------------------------------------------------------------------
    [2024-06-25T18:47:40+09:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
    [2024-06-25T18:47:40+09:00] FATAL: ---------------------------------------------------------------------------------------
    [2024-06-25T18:47:40+09:00] FATAL: RuntimeError: redis_service[redis] (redis::enable line 19) had an error: RuntimeError: ruby_block[warn pending redis restart] (redis::enable line 88) had an error: RuntimeError: Execution of the command `/opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket INFO` failed with a non-zero exit code (1)
    stdout:
    stderr: Could not connect to Redis at /var/opt/gitlab/redis/redis.socket: No such file or directory
    
    
    ===
    There was an error running gitlab-ctl reconfigure. Please check the output above for more
    details.
    ===
    
    dpkg: パッケージ gitlab-ce の処理中にエラーが発生しました (--configure):
     installed gitlab-ce package post-installation script subprocess returned error exit status 1
    xxd (2:8.1.2269-1ubuntu5.23) を設定しています ...
    vim-common (2:8.1.2269-1ubuntu5.23) を設定しています ...
    vim-tiny (2:8.1.2269-1ubuntu5.23) を設定しています ...
    dbus (1.12.16-2ubuntu2.3) のトリガを処理しています ...
    desktop-file-utils (0.24-1ubuntu3) のトリガを処理しています ...
    mime-support (3.64ubuntu1) のトリガを処理しています ...
    hicolor-icon-theme (0.17-2) のトリガを処理しています ...
    gnome-menus (3.36.0-1ubuntu1) のトリガを処理しています ...
    man-db (2.9.1-1) のトリガを処理しています ...
    処理中にエラーが発生しました:
     gitlab-ce
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    zen@LAB:~$

    もう一度、sudo apt upgrade を実行したところ、正常に終了した。

    sudo gitlab-ctl restart を実行するように出ていたので、実行した。

    GitLabのウェブ画面上からも確認したが、最新(17.1.0)にアップグレードができており、問題はなかった。

  • メモ:GitLab 16.9.2-ceからGitLab 16.10.3-ceへはapt updateでアップデートできた。

    油断すると、GitLab CEのアップデートがapt updateで失敗するので、メモ。

    GitLab 16.9.2-ceからGitLab 16.10.3-ceへはapt updateでアップデートできた。

  • UbuntuでGitLab CEの更新でGPGキーのエラーが出た

    Ubuntu 20.04 LTSで、apt updateでgitlab-ceの更新で、GPGキーのエラーが出た。エラーの原因は、GPGキーの有効期限が2024年3月1日までで、切れたため。その対応メモ。

    出力されたエラーメッセージ

    以下の署名が無効です: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>

    GPGキーの有効期限が2024年3月1日で切れているので、延長するために、下記のコマンドで更新を行った。

    curl -s "https://packages.gitlab.com/gpg.key" | sudo apt-key add -

    apt updateを実行してみると、同じようにエラーが表示された(前回と同じ方法では、うまくいかなかった)。公式の手順の内容を参考にして実行したところ、うまくいった。

    https://docs.gitlab.com/omnibus/update/package_signatures#update-keys-after-expiry-extension

    「signed-by」の機能を使用しているか、コマンドで確認する。

    grep 'deb \[signed-by=' /etc/apt/sources.list.d/gitlab_gitlab-?e.list

    Grepの結果が返される場合は、「signed-by」 を使用しているので、次のAWKコマンドを実行する。これで、GitLabリポジトリの公開鍵を更新する。要root権限。

     sudo awk '/deb \[signed-by=/{
           pubkey = $2;
           sub(/\[signed-by=/, "", pubkey);
           sub(/\]$/, "", pubkey);
           print pubkey
         }' /etc/apt/sources.list.d/gitlab_gitlab-?e.list | \
       while read line; do
         curl -s "https://packages.gitlab.com/gpg.key" | gpg --dearmor > $line
       done

    これで、あとはapt updateを行って、問題が解消しているか確認する。

    以下は、実行ログの抜粋。

    zen@LABO:~$ sudo apt update
    [sudo] zen のパスワード:
    ヒット:2 http://security.ubuntu.com/ubuntu focal-security InRelease
    ヒット:3 http://jp.archive.ubuntu.com/ubuntu focal InRelease
    取得:4 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
    ヒット:5 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease
    取得:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease [23.3 kB]
    エラー:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease
      以下の署名が無効です: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
    137 kB を 2秒 で取得しました (59.7 kB/s)
    パッケージリストを読み込んでいます... 完了
    依存関係ツリーを作成しています
    状態情報を読み取っています... 完了
    パッケージはすべて最新です。
    W: 署名照合中にエラーが発生しました。リポジトリは更新されず、過去のインデックス ファイルが使われます。GPG エラー: https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease: 以下の署名が無効です: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
    W: https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/dists/focal/InRelease の 取得に失敗しました  以下の署名が無効です: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
    W: いくつかのインデックスファイルのダウンロードに失敗しました。これらは無視され るか、古いものが代わりに使われます。
    zen@LABO:~$
    zen@LABO:~$ curl -s "https://packages.gitlab.com/gpg.key" | sudo apt-key add -
    OK
    zen@LABO:~$
    zen@LABO:~$ sudo apt update
    [sudo] zen のパスワード:
    ヒット:2 http://jp.archive.ubuntu.com/ubuntu focal InRelease
    ヒット:3 http://security.ubuntu.com/ubuntu focal-security InRelease
    取得:4 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
    ヒット:5 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease
    取得:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease [23.3 kB]
    エラー:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease
      以下の署名が無効です: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
    137 kB を 3秒 で取得しました (46.3 kB/s)
    パッケージリストを読み込んでいます... 完了
    依存関係ツリーを作成しています
    状態情報を読み取っています... 完了
    パッケージはすべて最新です。
    W: 署名照合中にエラーが発生しました。リポジトリは更新されず、過去のインデックス ファイルが使われます。GPG エラー: https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease: 以下の署名が無効です: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
    W: https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/dists/focal/InRelease の 取得に失敗しました  以下の署名が無効です: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
    W: いくつかのインデックスファイルのダウンロードに失敗しました。これらは無視され るか、古いものが代わりに使われます。
    zen@LABO:~$
    zen@LABO:~$  grep 'deb \[signed-by=' /etc/apt/sources.list.d/gitlab_gitlab-?e.list
    
    deb [signed-by=/usr/share/keyrings/gitlab_gitlab-ce-archive-keyring.gpg] https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ focal main
    zen@LABO:~$
    zen@LABO:~$
    zen@LABO:~$
    zen@LABO:~$ sudo su
    root@LABO:/home/zen#
    root@LABO:/home/zen#
    root@LABO:/home/zen# awk '/deb \[signed-by=/{
    >        pubkey = $2;
    >        sub(/\[signed-by=/, "", pubkey);
    >        sub(/\]$/, "", pubkey);
    >        print pubkey
    >      }' /etc/apt/sources.list.d/gitlab_gitlab-?e.list | \
    >    while read line; do
    >      curl -s "https://packages.gitlab.com/gpg.key" | gpg --dearmor > $line
    >    done
    root@LABO:/home/zen#
    root@LABO:/home/zen# apt update
    ヒット:2 http://security.ubuntu.com/ubuntu focal-security InRelease
    ヒット:3 http://jp.archive.ubuntu.com/ubuntu focal InRelease
    ヒット:4 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease
    ヒット:5 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease
    取得:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease [23.3 kB]
    取得:6 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal/main amd64 Packages [54.6 kB]
    78.0 kB を 3秒 で取得しました (22.6 kB/s)
    パッケージリストを読み込んでいます... 完了
    依存関係ツリーを作成しています
    状態情報を読み取っています... 完了
    アップグレードできるパッケージが 1 個あります。表示するには 'apt list --upgradable' を実行してください。
    root@LABO:/home/zen#
  • メモ:GitLab 16.7.3-ceからGitLab 16.9.0-ceへはapt updateでアップデートできた。

    断すると、GitLab CEのアップデートがapt updateで失敗するので、メモ。

    GitLab 16.7.3-ceからGitLab 16.9.0-ceへはapt updateでアップデートできた。

  • メモ:GitLab CE 16.7.0からGitLab CE 16.7.3へアップデート

    GitLab CE 16.7.0からGitLab CE 16.7.3へアップデートした。

    apt update, apt upgrade で問題なくアップデートできた。

  • GitLabo 16.4.0から16.6へは自動アップデートできた

    apt updateで、GitLabo 16.4.0から16.6へは自動アップデートできた。

  • メモ:GitLab CE 16.2からGitLab CE 16.4.1にアップデートした。

    また、小まめにGitLab CEのアップデートをやり忘れて、apt updateでのアップデートでエラーになった。今回は、GitLab CE 16.2から、GitLab CE 16.4.1へのアップデートだ。

    apt upgradeで発生したエラー(一部抜粋)は下記。

    gitlab preinstall: It seems you are upgrading from 16.2 to 16.4.
    gitlab preinstall: It is required to upgrade to the latest 16.3.x version first before proceeding.
    gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrade-paths
    dpkg: アーカイブ /tmp/apt-dpkg-install-33WUrh/15-gitlab-ce_16.4.1-ce.0_amd64.deb の処理中にエラーが発生しました (--unpack):
     new gitlab-ce package pre-installation script subprocess returned error exit status 1
    処理中にエラーが発生しました:
     /tmp/apt-dpkg-install-33WUrh/15-gitlab-ce_16.4.1-ce.0_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    まずは、GitLabのサイトで、アップグレードできるパスを調べる。

    https://docs.gitlab.com/ee/update/index.html#upgrading-to-a-new-major-version

    これによると、一度、16.3.5にアップグレードしてから、この時点の最新にアップグレードする必要があるとのこと。

    アップグレードパス : 16.2 → 16.3.5 → 16.4.1

    これを実行したコマンドは下記。段階的にアップデートして、最後に、GitLabを再起動する。

    sudo apt update
    sudo apt upgrade gitlab-ce=16.3.5-ce.0
    sudo apt upgrade gitlab-ce=16.4.1-ce.0
    sudo gitlab-ctl restart

    何度もやっているので、作業自体はこなれた感じだ。