502 Bad Gateway - nginx/1.14.0 (Ubuntu): ローカルにイメージが見つからない + デーモンからのエラー応答

最近、Dell サーバーを別の場所に移設しました。メインの OS/VM 管理ツールは Proxmox VE 5.3 です。いくつかの他の VM のリバースプロキシとして機能する Nginx VM を持っており、その中に Discourse VM も含まれています。

新しいルーターを構成した後、いくつかの VM がインターネットに接続できるようになりました(SSL 証明書の更新さえ不要でした)。しかし、Discourse にアクセスしようとすると、ブラウザで 502 Bad Gateway - nginx/1.14.0 (Ubuntu) というエラーが表示されます。

以前もこのエラーを受け取ったことがありますが、通常は以下の方法のいずれかで解決していました。

Discourse VM の再起動

ブラウザでは依然として 502 Bad Gateway - nginx/1.14.0 (Ubuntu) が表示されます。

ブラウザのクッキーをクリアして別のブラウザを試す

もし私の側で何か問題があるなら… いいえ。さまざまなブラウザでも同じ 502 Bad Gateway - nginx/1.14.0 (Ubuntu) エラーが発生します。

Discourse のクリーンアップとディスク容量の確認

当初、クリーンアップ時に約 4 GB のデータが削除されました。非常に驚きました。もしかすると、それが問題の原因だったのでしょうか?とにかく、今 Discourse をクリーンアップしようとすると:

> root@forum:/var/discourse# ./launcher cleanup
> WARNING! This will remove all stopped containers.
> Are you sure you want to continue? [y/N] y
> Total reclaimed space: 0B
> WARNING! This will remove all images without at least one container associated to them.
> Are you sure you want to continue? [y/N] y
> Total reclaimed space: 0B

また、ディスク容量が不足しているわけではないことを繰り返しておきます:

Git Pull

最新の状態です。

> root@forum:/var/discourse# git pull
> Already up to date.

Discourse の再起動

ここで、私が受け取っている 2 つのエラーを発見しました。

> root@forum:/var/discourse# ./launcher restart app
> 
> WARNING: We are about to start downloading the Discourse base image
> This process may take anywhere between a few minutes to an hour, depending on your network speed
> 
> Please be patient
> 
> Unable to find image 'discourse/base:2.0.20191013-2320' locally
> /usr/bin/docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
> See '/usr/bin/docker run --help'.
> Your Docker installation is not working correctly
> 
> See: `https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam`

提案されたリンクを確認しました。Git PullDiscourse の再構築(後で確認できます)を推奨しています。また、Docker の「Hello World」コマンドを実行することも提案されています。動作しますが(いくつかの問題があるように見えます):

> root@forum:/var/discourse# docker run -it --rm hello-world
> Unable to find image 'hello-world:latest' locally
> latest: Pulling from library/hello-world
> 1b930d010525: Pull complete
> Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
> Status: Downloaded newer image for hello-world:latest
> 
> Hello from Docker!
> This message shows that your installation appears to be working correctly.
> 
> To generate this message, Docker took the following steps:
>  1. The Docker client contacted the Docker daemon.
>  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
>     (amd64)
>  3. The Docker daemon created a new container from that image which runs the
>     executable that produces the output you are currently reading.
>  4. The Docker daemon streamed that output to the Docker client, which sent it
>     to your terminal.
> 
> To try something more ambitious, you can run an Ubuntu container with:
>  $ docker run -it ubuntu bash
> 
> Share images, automate workflows, and more with a free Docker ID:
>  https://hub.docker.com/
> 
> For more examples and ideas, visit:
>  https://docs.docker.com/get-started/
> 
> failed to resize tty, using default size

次に、Ubuntu Bash を試しましたが、エラーが発生しました。

> root@forum:/var/discourse# docker run -it ubuntu bash
> Unable to find image 'ubuntu:latest' locally
> docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/ubuntu/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fubuntu%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
> See 'docker run --help'.

他の既知の方法に進みましょう。

Discourse の停止と開始

再起動と同じエラーが表示されます。

> root@forum:/var/discourse# ./launcher stop app
> 
> WARNING: We are about to start downloading the Discourse base image
> This process may take anywhere between a few minutes to an hour, depending on your network speed
> 
> Please be patient
> 
> Unable to find image 'discourse/base:2.0.20191013-2320' locally
> /usr/bin/docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
> See '/usr/bin/docker run --help'.
> Your Docker installation is not working correctly
> 
> See: `https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam`
> 
> root@forum:/var/discourse# ./launcher start app
> 
> WARNING: We are about to start downloading the Discourse base image
> This process may take anywhere between a few minutes to an hour, depending on your network speed
> 
> Please be patient
> 
> Unable to find image 'discourse/base:2.0.20191013-2320' locally
> /usr/bin/docker: Error response from daemon: Get https://registry-1.docker.io/v2/discourse/base/manifests/2.0.20191013-2320: Get https://auth.docker.io/token?scope=repository%3Adiscourse%2Fbase%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
> See '/usr/bin/docker run --help'.
> Your Docker installation is not working correctly
> 
> See: `https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam`

Discourse の再構築

同じ 2 つのエラーが 再び 発生します。

> root@forum:/var/discourse# ./launcher rebuild app
> 
> WARNING: We are about to start downloading the Discourse base image
> This process may take anywhere between a few minutes to an hour, depending on your network speed
> 
> Please be patient
> 
> Unable to find image 'discourse/base:2.0.20191013-2320' locally
> /usr/bin/docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
> See '/usr/bin/docker run --help'.
> Your Docker installation is not working correctly
> 
> See: https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam

以前のバックアップからの復元

サーバーを移設し、クリーンアップ(約 4 GB のファイルが削除されたことについて前述)を行う前のスナップショットがあります。上記のすべてを再度試しましたが、同じ結果になりました(クリーンアップを除く)。また、ブラウザでは 502 Bad Gateway - nginx/1.14.0 (Ubuntu) が表示されます。したがって、これはクリーンアップとは無関係かもしれません。

Discourse を使用している間、私はこれら 2 つのエラーに遭遇したことがありません。これらのエラーを解決し、Discourse をブラウザで動作させるためにどのような対策を取ればよいでしょうか。