Недавно я переместил сервер Dell в другое место. Основная ОС/менеджер виртуальных машин — Proxmox VE 5.3. У меня есть ВМ с Nginx, которая работает как обратный прокси для нескольких других ВМ, одна из которых — ВМ с Discourse.
После настройки нового роутера я смог подключить несколько ВМ к Интернету (даже без необходимости обновления SSL-сертификатов). Однако при попытке доступа к Discourse в браузере я получаю ошибку 502 Bad Gateway - nginx/1.14.0 (Ubuntu).
Я уже сталкивался с этой ошибкой раньше, но обычно один из следующих методов её исправлял:
Перезапуск ВМ с Discourse
В браузере всё ещё отображается 502 Bad Gateway - nginx/1.14.0 (Ubuntu).
Очистка куки в браузере и попытка открыть в других браузерах
На случай, если проблема на моей стороне… нет. Та же ошибка 502 Bad Gateway - nginx/1.14.0 (Ubuntu) в разных браузерах.
Очистка Discourse и проверка свободного места на диске
При первоначальной очистке было удалено около 4 ГБ данных. Я был очень удивлён. Возможно, это и стало причиной проблемы? В любом случае, теперь при попытке выполнить очистку 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
Именно здесь я обнаружил две ошибки, которые получаю:
> 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 Pull и пересобрать Discourse (что вы увидите ниже). Также предлагается запустить команду 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
И снова получаю те же две ошибки.
> 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 ГБ файлов). Я снова попробовал все вышеописанные методы… и получил тот же результат (кроме очистки), а также ошибку 502 Bad Gateway - nginx/1.14.0 (Ubuntu) в браузере. Возможно, это вообще не связано с очисткой?
За всё время работы с Discourse я никогда не сталкивался с этими ошибками. Есть ли у кого-нибудь предложения, как их исправить и запустить Discourse в браузере?
