502 Bad Gateway - newbie help needed!

(Peter Richardson) #1


I think this may have happened at an upgrade point but either way - i’ve just got a 502 Bat Gateway error. I’ve looked at similar posts and it looks like I might need a rebuild or to reinstall Docker? Or both?

I’m a complete newbie using the command lines / Putty (sorry) so any step by step help would be very much appreciated! It was all working fine prior to this. It’s been installed with Digital Ocean.


(Matt Palmer) #2

Let’s start with the basics:

  • How exactly is your site setup? Is it a straightforward ./discourse-setup install, or is it more complicated (frontend proxy, other websites, custom configuration, etc). Did you install it using the Discourse-provided install guide from a pristine Ubuntu droplet, did you use the Digital Ocean one-click installer, or something else?
  • What did you do (exactly) between the last time you knew it was working, and now? What commands did you run (exact commands), what output did those commands return (exact, copy-pasted output)?
  • What does the nginx error log (/var/discourse/shared/standalone/log/var-log/nginx/error.log) contain?
  • What does the Rails application log (/var/discourse/shared/standalone/log/rails/production.log) contain?
  • What do the container logs report? (./launcher logs app)?

… and then, depending on what that turns up, there will probably be another round of questions.

(Sam Saffron) #3

My first guess, are you out of disk space ?

(Jeff Atwood) #4

Yeah before they do that, they should report free -m and df -m. Possibly docker version as well…

(Peter Richardson) #5

Thanks for the replies guys. I’ve attached screens of @codinghorror’s free -m and df -m. How do I report docker version?

I noticed it says there is a new release in the first part but don’t know if this is relevant:

Regarding @mpalmer’s questions - I’m probably to much of a newbie to Ubuntu / command lines in general to give you decent replies (sorry) but here goes:

  • I believe it was set up by @codinghorror as a standard install
  • I have no idea about exactly what commands were run. I’m 95% sure it was because I had been lax about updating. Then when I went to update, I had to do it manually as I was too far out of date (lesson learnt). I probably mucked something up there I expect. Or it failed to update. But probably me.
  • I might be doing this wrong for the log file - do I just type it in whilst in root directory? Says permission denied (same for the Rails application log):

For the last question - what do type in to get the container logs report? (sorry I can feel eyes rolling - told you I knew very little)

Appreciate the help & guidance guys.

Happy to reinstall anything if necessary. Would ideally like to avoid losing the database & settings but if there is no way round it, I can do :frowning:

(Arpit Jalan) #6

Hi @Primarypete,

I just performed a rebuild of your instance. It’s up now and running on latest Discourse version. :slight_smile:

(Peter Richardson) #7

wow - wasn’t expecting that - thanks! Awesome :smile: