GitLab CE を久々にアップデートしたら「It seems you are upgrading from 10.x version series to 12.x series.」って言われた件

2019年7月20日システムGit,Linux

GitLab CEを久々にアップデートしたら「It seems you are upgrading from 10.x version series to 12.x series.」って言われた件
GitLab CEを久々にアップデートしたら「It seems you are upgrading from 10.x version series to 12.x series.」って言われた件

久々にGitLab CEアップデートをしようとした時に「おや?」っとなった時の時系列に作業したこととかです。

GitLab CEをアップデートしようとした

まずはGitLab CEを久々に普通にyumアップデートしようとしたことから始まった。

$ sudo yum update
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
–> Running transaction check
—> Package gitlab-ce.x86_64 0:10.7.3-ce.0.el6 will be updated
—> Package gitlab-ce.x86_64 0:12.0.3-ce.0.el6 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================================
Updating:
gitlab-ce x86_64 12.0.3-ce.0.el6 gitlab_gitlab-ce 600 M

Transaction Summary
================================================================================================================================================================================================
Upgrade 1 Package

Total download size: 600 M
Is this ok [y/d/N]: y
Downloading packages:
gitlab-ce-12.0.3-ce.0.el6.x86_64.rpm | 600 MB 00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
gitlab preinstall: It seems you are upgrading from 10.x version series
gitlab preinstall: to 12.x series. It is recommended to upgrade
gitlab preinstall: to the last minor version in a major version series first before
gitlab preinstall: jumping to the next major version.
gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations
gitlab preinstall: and upgrade to 11.11 first.
error: %pre(gitlab-ce-12.0.3-ce.0.el6.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package gitlab-ce-12.0.3-ce.0.el6.x86_64
Verifying : gitlab-ce-12.0.3-ce.0.el6.x86_64 1/2
gitlab-ce-10.7.3-ce.0.el6.x86_64 was supposed to be removed but is not!
Verifying : gitlab-ce-10.7.3-ce.0.el6.x86_64 2/2

Failed:
gitlab-ce.x86_64 0:10.7.3-ce.0.el6 gitlab-ce.x86_64 0:12.0.3-ce.0.el6

Complete!

「ん?Compleate!って。。。」

何かエラーとか言ってんだろう??

早速翻訳にかけてみた。

It seems you are upgrading from 10.x version series to 12.x series. It is recommended to upgrade to the last minor version in a major version series first before jumping to the next major version.

あなたは10.xバージョンシリーズから12.xシリーズにアップグレードしているようです。次のメジャーバージョンにジャンプする前に、メジャーバージョンシリーズの最後のマイナーバージョンに最初にアップグレードすることをお勧めします。

なるほど。

GitLab CEはバージョン飛び越えてアップデートできないのね。。。

確かにさっきの yum update で

Package gitlab-ce.x86_64 0:10.7.3-ce.0.el6 will be updated

とか

Package gitlab-ce.x86_64 0:12.0.3-ce.0.el6 will be an update

って、バージョン10からバージョン12に飛んでたもんなぁ。

GitLab CEの過去バージョンをyumで一覧表示して確認してみる

手動でバージョンを上げていく必要があるということなので、yumで管理しているGitLab CEのパッケージの全バージョンを一覧で見てみる。

$ sudo yum list –showduplicates gitlab-ce | less
~省略~
gitlab-ce.x86_64 10.8.0-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 10.8.1-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 10.8.2-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 10.8.3-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 10.8.4-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 10.8.5-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 10.8.6-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 10.8.7-ce.0.el6 gitlab_gitlab-ce
~省略~

GitLab CEのバージョン10は、「10.8.7-ce.0.el6」が最新みたい。

GitLab CEをバージョン指定(gitlab-ce-10.8.7-ce.0.el6)してアップデートしてみる

ということで、GitLab CEのバージョンを指定してyumアップデートしてみる。

$ sudo yum install gitlab-ce-10.8.7-ce.0.el6
~省略~

_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/

Upgrade complete! If your GitLab server is misbehaving try running
sudo gitlab-ctl restart
before anything else.
If you need to roll back to the previous version you can use the database
backup made during the upgrade (scroll up for the filename).

Verifying : gitlab-ce-10.8.7-ce.0.el6.x86_64 1/2
Verifying : gitlab-ce-10.7.3-ce.0.el6.x86_64 2/2

Updated:
gitlab-ce.x86_64 0:10.8.7-ce.0.el6

Complete!

いったっぽい!

GitLab CEの過去バージョンをyumで一覧表示して確認してみる

yumで管理しているGitLab CEのパッケージの全バージョンからバージョン11を見てみる。

$ sudo yum list –showduplicates gitlab-ce | less
~省略~
gitlab-ce.x86_64 11.11.0-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 11.11.1-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 11.11.2-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 11.11.3-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 11.11.4-ce.0.el6 gitlab_gitlab-ce
gitlab-ce.x86_64 11.11.5-ce.0.el6 gitlab_gitlab-ce
~省略~

GitLab CEのバージョン11は、「11.11.5-ce.0.el6」が最新みたい。

GitLab CEをバージョン指定(gitlab-ce-11.11.5-ce.0.el6)してアップデートしてみる

GitLab CEのバージョン11を指定してyumアップデート。

$ sudo yum install gitlab-ce-11.11.5-ce.0.el6
~省略~
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/

Upgrade complete! If your GitLab server is misbehaving try running
sudo gitlab-ctl restart
before anything else.
If you need to roll back to the previous version you can use the database
backup made during the upgrade (scroll up for the filename).

Verifying : gitlab-ce-11.11.5-ce.0.el6.x86_64 1/2
Verifying : gitlab-ce-10.8.7-ce.0.el6.x86_64 2/2

Updated:
gitlab-ce.x86_64 0:11.11.5-ce.0.el6

Complete!

これでOKかな。

GitLab CEをバージョンアップデートする

最後にyum updateして完了だ!

$ sudo yum update
~省略~
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/

Upgrade complete! If your GitLab server is misbehaving try running
sudo gitlab-ctl restart
before anything else.
If you need to roll back to the previous version you can use the database
backup made during the upgrade (scroll up for the filename).

Verifying : gitlab-ce-12.0.3-ce.0.el6.x86_64 1/2
Verifying : gitlab-ce-11.11.5-ce.0.el6.x86_64 2/2

Updated:
gitlab-ce.x86_64 0:12.0.3-ce.0.el6

Complete!

最新バージョンになった!

それでは動作確認でブラウザでアクセス。

Whoops, GitLab is taking too much time to respond.

って言われた。(これはアップデートすると毎回出るエラーみたい)

「Whoops, GitLab is taking too much time to respond.」って言われたから対応

何やらGitLab CEの設定を再構築する必要があるみたい。
なので

$ sudo gitlab-ctl reconfigure

Running handlers:
Running handlers complete
Chef Client finished, 4/660 resources updated in 06 seconds
gitlab Reconfigured!

をして、再度ブラウザでアクセス。

「OK、オワタ―――――」

めも

先日に(またまた)久々にアップデートしたら、GPG keyの更新が行われました。

$ sudo yum update
Loaded plugins: priorities, update-motd, upgrade-helper
gitlab_gitlab-ce/x86_64/signature                                                                                                                                        |  862 B  00:00:00
Retrieving key from https://packages.gitlab.com/gpg.key
Importing GPG key **********:
 Userid     : "GitLab B.V. (package repository signing key) <packages@gitlab.com>"
 Fingerprint: **** **** **** **** **** **** **** **** **** ****
 From       : https://packages.gitlab.com/gpg.key
Is this ok [y/N]: y
gitlab_gitlab-ce/x86_64/signature                                                                                                                                        | 1.0 kB  00:00:13 !!!
gitlab_gitlab-ce-source/signature                                                                                                                                        |  862 B  00:00:00
Retrieving key from https://packages.gitlab.com/gpg.key
Importing GPG key **********:
 Userid     : "GitLab B.V. (package repository signing key) <packages@gitlab.com>"
 Fingerprint: **** **** **** **** **** **** **** **** **** ****
 From       : https://packages.gitlab.com/gpg.key
Is this ok [y/N]: y

GPG keyについては「GPG key sign 備忘録」に詳しく書かれていました。

脆弱性の報告

2020年4月に報告されていたGitLabにおける脆弱性が2020年11月に公開されました。

影響うけるバージョン
GitLab のバージョン 8.5.0 から 12.9.0 が当該脆弱性の影響を受けると報告されています。

参照:GitLab において Issue の値処理の不備によりサーバ内の任意のファイルが読み取り可能となる脆弱性(Scan Tech Report)

おわりに

何でもそうですが小まめにメンテナンスすることって大事ですね(汗)
今回の事が起こらないように注意して運用していこうと思いますー。

  • バージョンアップはこまめにすること!
  • もしバージョンアップをさぼると手動でバージョンを上げていく必要がある

最近は休日出勤しちゃうくらい社畜気味なので、ブログ書く気になれない日々です。。
来月過ぎたくらいには解放されるんじゃないかなぁっと信じて日々精進なのであります♪

参考サイト

プログラミングスクール受講メリット

・メンターにすぐ聞けるので分からないところでつまづかない
・受講生同士で学び合いモチベーション維持しやすい
・就学後に就職支援や進路サポートを受けることが出来る

ユート
ユート

1985年生まれ1児の父親です。Web系エンジニアを10年以上しています。
プロフィール
Amazon欲しいものリスト

2019年7月20日システムGit,Linux

Posted by ユート