Thomas_Rother encountered a Pups exec error during Discourse bootstrap, specifically failing at bundle exec rake db:migrate with exit code 1. Initial guesses by Ed_S about insufficient memory were ruled out by Thomas_Rother, who confirmed 4GB RAM and adequate disk space. Falco requested full logs and questioned the setup, noting that a web_only container shouldn’t run Redis — an issue Thomas_Rother acknowledged and corrected. Despite fixing Redis separation, the error persisted. Ed_S pointed to Redis port conflicts (6379 already in use), suggesting lsof to diagnose. pfaffman urged sharing full logs, suspecting missing PostgreSQL extensions, especially after seeing PG::DuplicateObject: ERROR: type "hotlinked_media_status" already exists in the logs Thomas_Rother later provided. Falco confirmed that Discourse auto-creates the database if credentials are valid and reachable. RGJ suggested checking database user permissions. Ultimately, Thomas_Rother resolved the issue by manually running CREATE EXTENSION hstore; and CREATE EXTENSION pg_trgm; on the external PostgreSQL server — extensions required by Discourse but missing in the new database setup. The fix highlights the importance of ensuring PostgreSQL extensions are installed before bootstrap when using an external database.
I am creating a new discourse instance from scratch for development purposes and see this bootstrap error again:
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1002 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 {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
Container setup is with two containers for webonly and dataonly (redis) and with an external postgresql database. Commenting the maxmind settings does not change anything.
Hmmm, nein, wir haben 4 GB RAM und ausreichend Festplattenspeicher (2 x 32 GB), die Gesamtumgebung ist identisch mit der anderen Docker-Maschine, auf der die Builds ohne Probleme laufen.
OK, I fixed the separation of web_only and redis. Error msg now is
FAILED -------------------- Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 981 e xit 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 {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migra te'"]} bootstrap failed with exit code 1 ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one. ./discourse-doctor may help diagnose the problem. 801049b69a89d38b1ae5c299d356fc5f8dc6a8f518b1260c2dde05e0b6081556
But maybe its a misunderstanding / lack of knowledge on my side:
The database should be external on another lxc container which has a postgresql database. The database user and database exists, but the database is empty before the first bootstrap of web_only. Does the script create the database itself on the remote system upon first build? Or do I first have to create the database container and then export its default scheme and the data manually to the external postgresql daemon?
Thanks for the diagram. That’s quite a sophisticated setup - you’d do that if you had a good reason and knew the territory.
If you’re still seeing the following, I think that’s the indication of what’s wrong. Redis can’t open the port it needs to be listening on.
So the questions are about whether redis should be doing that, in this container, and if so, where else on the machine is another redis running. lsof might be a useful tool here.
Hi @Ed_S
thanks for the hint about the missing port. I first want to wait for the reply from Falco concerning my questions about the general setup of discourse with an external postgres database.
Yes, the setup is a bit sophisticated compared to the standard with just one app container. I run everything in a dedicated root machine with Proxmox (https://proxmox.com) as virtualization environment at hetzner.de
You still need to share the full logs, including the part where the migration failed. My guess (and it’s a guess since you haven’t shared the error) is that you’re using the AI plugin and your database doesn’t have the add-on that is required.
I now think the better approach would be to create a standard “all in one” setup first (app.yml). And then sql dump the initial schema and data from the container into an external postgres machine. @Falco what do you think?
The installer will automatically create everything that is necessary as long as it’s supplied valid credentials and is able to reach the database. This is documented at Configure Discourse to use a separate PostgreSQL server