Site not accessible from browser - docker problems

I was trying to install Forest Admin and it required docker-compose.

Since I didn’t have it, I installed it:

sudo apt  install docker-compose

But when I tried to run it, I got an error:

docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

I tried several things and one recommended restarting docker:

sudo systemctl restart docker
Failed to restart docker.service: Unit docker.service is masked.

So I unmasked it and rebuilt, but then I couldn’t access the app

sudo systemctl unmask docker
Removed /etc/systemd/system/docker.service.

sudo systemctl restart docker
# no error

I’ve been able to rebuild the image and it finishes without errors:

sudo /var/discourse/launcher rebuild app

But when I go to the URL, it’s not accessible.

Out of desperation, I also tried updating docker and rebuilding the image several times, but no luck:

wget -qO- https://get.docker.com/ | sh

sudo /var/discourse/launcher rebuild app

I’m out of ideas. Is there anything else I should try?

I’d like to avoid having to restore from a backup because I’d lose some data, but if that’s the only way, what’s the best approach?

  • Restore my latest Digital Ocean backup
  • Restore my latest Discourse backup

I can’t tell if you broke docker or if forest admin is keeping discourse from working. What problem is forest admin solving?

Thanks, Jay. Let’s forget about Forest Admin. I removed it for now. Is there anything else I could do to diagnose the problem?

I’m pretty sure I broke docker. In case it’s relevant, before I had docker 18.09.6, build 481bc77 and now I have 20.10.2, build 2291f61.

Okay. It turns out the solution was much simpler: I just needed to restart nginx :sweat_smile:

When I tried to do it, I got this error:

sudo service nginx restart
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

I didn’t see anything obvious in the logs, but restarting the server did the trick:

sudo shutdown -r now

Now the site is working correctly

3 Likes

You do not need nginx. My guess is that when you restarted it, Discourse managed to grab port 80 while nginx was restarting. And you lucked out that when you rebooted discourse managed to boot up before nginx. You should uninstall or disable nginx (unless you configured it as a reverse proxy, which you can’t do with discourse-setup).

1 Like

Thanks, Jay. I had nginx set up as a reverse proxy to show a nice page when I’m rebuilding.

2 Likes