Connection error after resizing DO Droplet


(Thomas K. Running) #1

Hi guys, I resized my DigitalOcean droplet today, and after that process was completed I haven’t been able to access my Discourse forum (I’m getting ERR_CONNECTION_REFUSED).

It looks like something other than Discourse is using port 80… This is what I get when trying to restart the app (I have also rebuilt it, and restarted the DO droplet itself):

root@community:/var/discourse# ./launcher restart app
+ /usr/bin/docker stop -t 10 app
app

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: driver failed programming external connectivity on endpoint app (aa51af7b44babc340fc1101b508092e99c65b05cdda7c39ce8337d4f56f0bde7): Error starting userland proxy: listen tcp 0.0.0.0:80: listen: address already in use
Error: failed to start containers: app

Any ideas how I can continue debugging or getting this fixed? Discourse was running perfectly fine until I resized the droplet…


(Andrew Schleifer) #2

Run netstat -plnt to find what is listening on port 80.


(Jay Pfaffman) #3

You probably have Nginx or Apache installed on the server. You should remove them and

cd /var/discourse
./discourse-setup

to reconfigure Discourse for the amount of RAM you have.


(Thomas K. Running) #4

Yup, looks like apache was listening.

root@community:~# netstat -plnt
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:22              0.0.0.0:*               LISTEN      1318/sshd       
tcp6       0      0 :::80                   :::*                    LISTEN      1478/apache2    
tcp6       0      0 :::22                   :::*                    LISTEN      1318/sshd       

For future reference (or to help other noobs), I ran sudo apache2ctl stop, then ./discourse-setup like @pfaffman suggested to reconfigure for the new amount of RAM. At the end of that process discourse was rebuilt and my site is back up!

I’m not sure if this was necessary, but finally I ran sudo systemctl disable apache2 to make sure apache does not run when my droplet is restarted in the future. (Source)

Thanks a lot guys!


(Andrew Schleifer) #5

Yes, that was a very good idea.


(Jay Pfaffman) #6

Right. Perhaps a better idea would be

apt purge apache2

but that’s assuming that your apache server package is named just that. You can see what all apache stuff is installed like

sudo dpkg -l |grep apach

You really need to un-install the main server part. The other stuff won’t hurt you and can get removed with

apt -y autoremove