Recently I moved my Dell Server from one location to another. Its Main OS/VM Manager is Proxmox VE 5.3. I got an Nginx VM that is Reverse Proxying several other VMs, one of which is a Discourse VM.
After configuring my new Router, I got several of my VMs to connect to the Internet (not even needing to renew the SSL certificates). However, with Discourse, I am receiving 502 Bad Gateway - nginx/1.14.0 (Ubuntu)
when trying to access Discourse in a Browser.
I have received this error before, but usually one of the below methods fixes it:
Restarting Discourse VM
Still 502 Bad Gateway - nginx/1.14.0 (Ubuntu)
in a Browser.
Clearing Browser Cookies and Trying Different Browsers
Just in case it’s something on my end … nope. Same 502 Bad Gateway - nginx/1.14.0 (Ubuntu)
in various Browsers.
Discourse Cleanup and Checking Diskspace
Initially when cleaning up, it removed about 4 GB of data. I was very surprised. Maybe that is what caused the problem in the first place? Anyways, now when I try to cleanup 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
I also want to reiterate that I am not out of disk space:
Git Pull
It’s up to date.
> root@forum:/var/discourse# git pull
> Already up to date.
Restarting Discourse
This is where I discovered two errors that I’m receiving:
> 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`
Checked out the suggested link. It recommends a Git Pull and to Rebuild Discourse (which you’ll see what I get later below). It also suggests running a Docker “Hello World” command. It works (although seems to have some problems?):
> 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
Well, next I tried the Ubuntu Bash … and error:
> 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'.
Time to move on to some other methods I know:
Stopping and Starting Discourse
Receiving the same thing as with the Restart:
> 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`
Rebuild Discourse
And getting the same two errors again.
> 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
Restoring from a Previous Backup
I have a snapshot from a time before I moved the Server and did the Cleanup (which as mentioned, cleaned up about 4 GB of files). I tried all of the above again … and same thing (minus the Cleanup), as well as the 502 Bad Gateway - nginx/1.14.0 (Ubuntu)
in a Browser. So perhaps this has nothing to do with the Cleanup?
In all my time with Discourse, I’ve never run into either of these errors. Any suggestions on what I can do to resolve these errors and get Discourse running in a browser?