The discussion revolves around a 502 error on an nginx setup for a Discourse installation. elopio initially reports the issue, sharing the error log and netstat output. itsbhanusharma suggests that the error may be due to services starting up, which should resolve within 30 seconds. However, elopio confirms that the CPU load is well under 10%, ruling out extreme load as the cause.
Stephen asks about installed plugins and the server’s storage type, which elopio reveals to be a non-SSD drive with default plugins. neounix requests the yml file, which elopio shares. Stephen points out that Discourse requires SSD, but neounix disagrees, stating that a traditional hard drive should not cause a 502 error.
However, Stephen counters that slow IO can indeed cause timeouts and 502 errors. neounix suggests monitoring the Rails and nginx logs to debug the issue. elopio discovers permission errors in the unicorn log, resolves the issue by deleting the cache, and successfully accesses the Discourse installation.
Finally, elopio shares the successful migration of a Costa Rican hackerspace from Telegram to Discourse, thanking the community for their help.
It shows 502 initially as the services inside the container are starting up. It should go away within 30 seconds. If it doesn’t it is possible that your server’s CPU is under extreme load and it is causing slowdown.
I’ve just cloned the repository and run the setup commands, so I guess it just has the default plugins? Not sure where to check, but I’m sure I’ve added none.
Using a traditional hard drive versus an SSD drive should not cause a 502 error. That’s not really plausible, as your question indicates @elopio.
Here is a little writeup which might be helpful:
The best thing to do, in my view, is to open up some terminals and run tail -f on your both your Rails and nginx log files, including the error logs and access logs; and then try to access and make sure when you see the 502 error you have your eyes on the tails of the log files.
Do you know where those logfiles reside and how to run tail -f commands on them in terminals?
Note, you asked earlier:
Rails run on port 3000 inside the Docker container and that port is not exposed outside the container. That is why you are not seeing port 3000 outside the container when you run netstat outside the container.
Wooo, looking at the rails logs I found that the unicorn log was huge, complaining about some permission errors. I deleted rm -rf tmp/cache/bootsnap-compile-cache/, and now I see the congratulations screen!!!
Thank you friends. I’ll play with this a little more before deciding to recreate it in an SSD server.
It’s the migration of the Costa Rican hackerspace from Telegram to Discourse We still have to do sooo many things, but this time I’m sure we’ll be able to get rid of the chat for sure. Thanks a lot discourse people!