LoginSignup
8
9

More than 1 year has passed since last update.

GitLab 13リリース!!(アップデートでハマった。。。)

Last updated at Posted at 2020-05-25

GitLab13がリリースされました!

早速バージョンアップしてみました。
が、いつものノリでバージョンアップしようとしたら起動できなかったので備忘録を残しておこうと思います。

※ちなみに元のバージョンは12.4.2です。

追記)13 => 14へアップデート

構成

docker-composeにてgitlabコンテナとgitlab-runnerコンテナを立ち上げてます
詳細は以下の記事をご覧ください

アップデート手順

  • バックアップ(v12.4.2)取得
  • docker-compose downで古いバージョンのコンテナを削除
  • docker-compose.ymlを修正
    • gitlab:gitlab/gitlab-ce:13.0.0-ce.0
    • gitlab-runner:gitlab/gitlab-runner:v13.0.0
  • docker-compose upで新しいバージョンでコンテナ作成

 ↓

エラー

原因

Postgresへの接続に失敗していた

Postgresのバージョンは最低11でないといけない

調べたところ、GitLab13からPostgresのバージョンは11以上でないといけなくなったようです。
https://docs.gitlab.com/omnibus/update/gitlab_13_changes.html#postgresql-11-becoming-minimum-required-version

Postgresのバージョンアップ方法

以下のコマンドでアップデートできるらしい
参考: https://docs.gitlab.com/omnibus/settings/database.html#gitlab-128-and-later

docker exec -t gitlab gitlab-ctl pg-upgrade -V 11

試してみたが、エラーになった。。。
⇒GitLab12.4.2だと-Vオプションはないっぽい。。。

root@f8abdac87dcf:/# gitlab-ctl pg-upgrade -V 11
Traceback (most recent call last):
        6: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
        5: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
        4: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:31:in `<top (required)>'
        3: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:746:in `run'
        2: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:204:in `block in add_command_under_category'
        1: from /opt/gitlab/embedded/service/omnibus-ctl/pg-upgrade.rb:68:in `block in load_file'
/opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/pg_upgrade.rb:155:in `parse_options': invalid option: V (OptionParser::InvalidOption)
        6: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
        5: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
        4: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:31:in `<top (required)>'
        3: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:746:in `run'
        2: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:204:in `block in add_command_under_category'
        1: from /opt/gitlab/embedded/service/omnibus-ctl/pg-upgrade.rb:68:in `block in load_file'

一旦 GitLab 12.10.0にアップデートしてやる

12.10.0はデフォルトでPostgres11らしいので、12.4.2⇒12.10.0のアップデートを挟む
参考:https://docs.gitlab.com/omnibus/settings/database.html#gitlab-1210-and-later

最終的なバージョンアップ手順

  • バックアップを取得
  • docker-compose downで一旦古いバージョンのコンテナを削除
  • docker-compose.ymlを修正(v12.10.0)
    • gitlab:gitlab/gitlab-ce:12.10.0-ce.0
    • ※gitlab-runnerの方は更新しなくても問題ない
  • バックアップを取得(v12.10.0)
    • 起動できているか確認
  • docker-compose downで一旦古いバージョンのコンテナを削除
  • docker-compose.ymlを修正(v.13.0.0)
    • gitlab:gitlab/gitlab-ce:13.0.0-ce.0
    • gitlab-runner:gitlab/gitlab-runner:v13.0.0
  • docker-compose upでバージョン13のコンテナを作成
8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9