More than 5 years have passed since last update.
外付けNGINX環境でGitLab v13.5にアップデートすると502 Bad Gateway
概要
GitLab v13.5にアップデートしたら 502 Bad Gatewayになった。
なにが悪かったかのかを簡単にまとめる。
先に結論
悪いのはGitLabではなく、NGINXのリバースプロキシ設定を変えなくてはならないのに変えなかったから。
発生環境
-
Ubuntu18.04 -
GitLabv13.5.1 Omnibus版- アップデート前は v13.4.3
-
NGINXv1.19.3- Omnibus版同梱ではなく、独立して動いている
何が起こったか?
GitLab v13.4.3 -> v13.5.1にアップデートしたら502 Bad Gatewayになった。
慌ててGitLabの動作確認するも問題なし
$sudo gitlab-ctl status
# ここにいっぱいRUNって出てる。
原因を見つける
なんやかんやあってGitLab v13.5リリースBlog見ると次の一文があった。1
👁 スクリーンショット 2020-11-05 0.13.13.png
The default path for the Workhorse socket changed from /var/opt/gitlab/workhorse/socket to /var/opt/gitlab/workhorse/sockets/socket in 13.5. A gitlab-ctl reconfigure is required during upgrade to apply this change. If you use SELinux and have specified a custom socket path, see the upgrade documentation for some manual steps that are required.
もう一度特に重要なところを
The default path for the Workhorse socket changed from to in 13.5.
まじでImportant
対策
NIGNXのリバースプロキシ設定のconfファイル
よくある場所だと etc/nginx/sites-available/GitLab.confとか
upstream gitlab-workhorse {
# On GitLab versions before 13.5, the location is
# `/var/opt/gitlab/gitlab-workhorse/socket`. Change the following line
# accordingly.
+ server unix:/var/opt/gitlab/gitlab-workhorse/sockets/socket fail_timeout=0;
}
ソケットのパスを/var/opt/gitlab/gitlab-workhorse/sockets/socketに変えればOK
参考サイト
- Permission denied on sockets after update to "13.5.1-ce.0"
- https://gitlab.com/gitlab-org/gitlab-recipes/-/tree/master/web-server/nginx
-
ページの1番下に書いてある。 ↩
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
