500 Internal Server Error on various routes


I’m trying to debug recurring 500 Internal Server Error.
First the setup (I know this is not ideal and not the recommended deployment using docker):

  • discourse 2.3.8
  • ruby 2.7.2 (using the snap)
  • redis-server 5:4.0.9-1ubuntu0.2 (ubuntu package)
  • postgresql 10.15 (on another host)

I edited the config/environments/production.rb file to set

config.log_level = :debug

A sample of the kind of error we see (mixed with 200) can be found here (also the rest as I cannot put more than 2 links in a post): Ubuntu Pastebin

I tried to determine if a particular kind of request was generating the 500 and there is some kind of pattern indeed (see previous pastebin).

I’m failing to find a way to debug further for now.
I’m not quite sure this is a bug, and I sadly don’t have a way to reproduce. Those errors happen randomly through the day, in between 200. This might be some lock/contention issue, but without further logs, I’m not really able to find where the issue lies.

Here are the limits currently used for the process, in case this is the issue : Ubuntu Pastebin

Any help on how to debug further would be much appreciated.


Discourse 2.3.8 is very old and won’t work with a recent Ruby like 2.7.2.

We know that Discourse 2.5.6, 2.6 and 2.7 work with Ruby 2.7.2.

1 Like

Hi Rafael,

Thanks for your answer. We plan to upgrade and use the supported deployment method for sure “soon”.

I was mainly trying to find how to increase the debug messages besides modifying the config/environments/production.rb file.

I saw that logster (Discourse Logging Improvements) could be used but it doesn’t provide anything useful in our case (I’m missing the seconds here, to see if this is related to my 500 or not) and there is too many errors, probably related to this mismatch ruby/discourse version.

I’ll try to poke a bit more but I’m definitely pushing for the upgrade “sooner” than “soon” :).

Thanks !