Hi everyone!
**This is my first post. **
I’m a new Discourse user coming from phpBB.
Two weeks ago, I installed Discourse in a Docker container using Nginx, since Apache uses ports 80 and 443 by default. I carefully followed the steps outlined in the installation guides and the Nginx multisite configuration.
**I was able to run and use the forum for a week, only occasionally logging in to familiarize myself with the platform. When I asked one of the users to register and test it, the forum crashed the next day. The browser displayed the message: “The software powering this discussion forum encountered an unexpected problem.” I couldn’t fix it, so I reinstalled the entire forum from scratch and then restored the threads from the last available backup. This was last Thursday. After all this, the forum was back up and running. Now, it’s back up again with a 502 Bad Gateway Nginx error. I went straight for the rebuild app and it crashed again with the error:
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 580 exit 1>
.
This same thing happened over and over again last week and it led me to reinstall everything from scratch. The forum is practically inactive because I haven’t made it public yet. I’m scared of the idea that if it keeps crashing without activity, what could happen with a larger user group? Run these commands: ./launcher enter app**
**cd /var/www/discourse**
**su discourse -c 'bundle exec rake db:migrate'**
**And in the response, I see this that caught my attention:
connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: the database system is starting up**
I tried restarting Postgress manually and running the rebuild again, but the process was interrupted again with this error message:
**FAILED**
**--------------------**
**Pups::ExecError: if [ -f /root/install_postgres ]; then**
**/root/install_postgres && rm -f /root/install_postgres**
**elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then**
**socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1**
**fi**
** failed with return #<Process::Status: pid 18 exit 1>**
**Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'**
**exec failed with the params {"tag"=>"db", "cmd"=>"if [ -f /root/install_postgres ]; then\n /root/install_postgres && rm -f /root/install_postgres\nelif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then\n socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container exit ; 1\nfi\n"}**
**bootstrap failed with exit code 1**
I’m not really an experienced user to identify the error, but I suspect that Postgres will break at some point. This led me to restart everything and start over last week, but I don’t think this is a common or healthy practice for anyone.
Discourse is running on a server with 4 cores, 6GB of RAM, and 180GB of disk space. I’m currently only running this installation of Discourse, so from what I understand, I’m not limited by hardware.