Site's down - app won't start, port 443 conflict?

I have Discourse installed in a Ubuntu 18.04 VPS following the standard install instructions. It’s been running well for a couple of years now, but when I went to my site this afternoon, the TLS cert was expired–and since it uses HSTS, that means I was completely locked out of the site. Easy enough, I thought, SSH into the server, install updates (just because), run ./launcher rebuild app, and she’ll be right, mate.

Nope, it didn’t work that way; I got an “oops” page. So I decided to reboot the system, and now I’m getting a 502 page when I try to browse there. I can’t start app:

root@talk:/var/discourse# ./launcher start app
x86_64 arch detected.

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: driver failed programming external connectivity on endpoint app (e5db356e19c947c3e1e20a337aea7ee4bdcfa9bc5f3eac485e76439f3ed3a0e9): Bind for 0.0.0.0:443 failed: port is already allocated
Error: failed to start containers: app

…and there is indeed something listening on port 443:

root@talk:/var/discourse# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      906/docker-proxy    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      427/systemd-resolve 
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      918/docker-proxy    
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      892/docker-proxy    
tcp6       0      0 :::9936                 :::*                    LISTEN      578/sshd            
udp        0      0 127.0.0.53:53           0.0.0.0:*                           427/systemd-resolve 

I’m afraid I’m stumped–what should I check next?

3 Likes

Has it need a long time since you did a rebuild? Were there any errors? Did it say something about upgrading postgres? Maybe rebuild again.

2 Likes

Another thing you could check is whether a different Discourse container is running, e.g. import. Running the following command and if there are additional containers, looking at the status and ports columns will answer that:

docker container ls
2 Likes

I’ve been keeping the site up-to-date; I recall the postgres upgrade some time back and I handled that then. I don’t recall seeing anything about it this time around, but it’s easy enough to run another rebuild. But while doing that, I saw:

…and indeed import is running. So I stopped that, and once the rebuild finished, the site came back up.

And the Let’s Encrypt cert is renewed (it seems several were issued today, which is a little troublesome), so all’s back now. Thanks for the quick response.

3 Likes

Then you want to.

  ./launcher destroy import
3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.