Recentemente ho spostato il mio server Dell da una posizione all’altra. Il suo sistema operativo principale/Gestore di VM è Proxmox VE 5.3. Ho una VM Nginx che fa da Reverse Proxy per diverse altre VM, una delle quali è una VM Discourse.
Dopo aver configurato il mio nuovo router, ho fatto sì che diverse delle mie VM si connettessero a Internet (senza nemmeno dover rinnovare i certificati SSL). Tuttavia, con Discourse, ricevo 502 Bad Gateway - nginx/1.14.0 (Ubuntu) quando provo ad accedere a Discourse da un browser.
Ho ricevuto questo errore in passato, ma di solito uno dei metodi seguenti lo risolve:
Riavvio della VM Discourse
Ancora 502 Bad Gateway - nginx/1.14.0 (Ubuntu) nel browser.
Cancellazione dei cookie del browser e prova con browser diversi
Solo per escludere che il problema sia dalla mia parte… no. Stesso 502 Bad Gateway - nginx/1.14.0 (Ubuntu) in vari browser.
Pulizia di Discourse e controllo dello spazio su disco
Inizialmente, durante la pulizia, sono stati rimossi circa 4 GB di dati. Sono rimasto molto sorpreso. Forse è quello che ha causato il problema in primo luogo? Comunque, ora quando provo a pulire 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
Voglio anche ribadire che non sono a corto di spazio su disco:
Git Pull
È aggiornato all’ultima versione.
> root@forum:/var/discourse# git pull
> Already up to date.
Riavvio di Discourse
È qui che ho scoperto due errori che sto ricevendo:
> 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`
Ho controllato il link suggerito. Raccomanda un Git Pull e di Ricostruire Discourse (come vedrai più avanti). Suggerisce anche di eseguire un comando Docker “Hello World”. Funziona (anche se sembra avere alcuni problemi?):
> 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
Bene, dopo ho provato Ubuntu Bash… ed errore:
> 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'.
È il momento di passare ad altri metodi che conosco:
Arresto e avvio di Discourse
Ricevo la stessa cosa che con il Riavvio:
> 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`
Ricostruzione di Discourse
E ricevo di nuovo gli stessi due errori.
> 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
Ripristino da un backup precedente
Ho uno snapshot di un periodo precedente allo spostamento del server e alla pulizia (che, come detto, ha rimosso circa 4 GB di file). Ho riprovato tutti i metodi sopra… e la stessa cosa (esclusa la Pulizia), oltre al 502 Bad Gateway - nginx/1.14.0 (Ubuntu) nel browser. Quindi forse non c’entra nulla con la pulizia?
In tutto il tempo che uso Discourse, non mi sono mai imbattuto in nessuno di questi errori. Qualche suggerimento su cosa posso fare per risolvere questi errori e far funzionare Discourse nel browser?
