Discourse Launcher Failed to Bootstrap

Hello. I’ve been trying to migrate our current Discourse server and am trying to do a fresh install on our new VPS, but using our App config bootstrap was failing with a weird error.
I tried bootstrapping from scratch with the ./discourse-setup script but even that was failing. Was wondering if there are any issues with the script at the moment?
Error seen below:

I, [2025-04-17T08:59:36.609118 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile:build'
Node.js heap_size_limit is less than 2048MB. Setting --max-old-space-size=2048 and CHEAP_SOURCE_MAPS=1
No existing build info file found.
Running full core build...
...[ConfigLoader]
...[Babel: @embroider/macros > applyPatches]
...[Babel: @ember/legacy-built-in-components > applyPatches]
...[Babel: ember-source > applyPatches]
[BABEL] Note: The code generator has deoptimised the styling of /var/www/discourse/app/assets/javascripts/discourse/ember/ember-template-compiler.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /var/www/discourse/app/assets/javascripts/discourse/ember/ember.js as it exceeds the max of 500KB.
...[Babel: @glimmer/component > applyPatches]
...[Babel: dialog-holder > applyPatches]
...[Babel: ember-buffered-proxy > applyPatches]
...[Babel: float-kit > applyPatches]
...[Babel: select-kit > applyPatches]
...[@embroider/compat/app]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
/var/www/discourse/script/assemble_ember_build.rb:103:in `system': Command failed with exit 1: pnpm (RuntimeError)
        from /var/www/discourse/script/assemble_ember_build.rb:103:in `<main>'
I, [2025-04-17T09:00:51.861399 #1]  INFO -- : Building
Environment: production
The setting 'staticAddonTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTrees: true' in your Embroider config.
The setting 'staticAddonTestSupportTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTestSupportTrees: true' in your Embroider config.
building...
undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command was killed with SIGKILL (Forced termination): ember build -prod

I, [2025-04-17T09:00:51.867412 #1]  INFO -- : Terminating async processes
I, [2025-04-17T09:00:51.867492 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/15/bin/postmaster -D /etc/postgresql/15/main pid: 60
I, [2025-04-17T09:00:51.867579 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 127
127:signal-handler (1744880451) Received SIGTERM scheduling shutdown...
2025-04-17 09:00:51.867 UTC [60] LOG:  received fast shutdown request
127:M 17 Apr 2025 09:00:51.877 # User requested shutdown...
127:M 17 Apr 2025 09:00:51.878 * Saving the final RDB snapshot before exiting.
2025-04-17 09:00:51.887 UTC [60] LOG:  aborting any active transactions
2025-04-17 09:00:51.892 UTC [60] LOG:  background worker "logical replication launcher" (PID 74) exited with exit code 1
2025-04-17 09:00:51.898 UTC [69] LOG:  shutting down
2025-04-17 09:00:51.914 UTC [69] LOG:  checkpoint starting: shutdown immediate
127:M 17 Apr 2025 09:00:51.920 * DB saved on disk
127:M 17 Apr 2025 09:00:51.921 # Redis is now ready to exit, bye bye...
2025-04-17 09:00:52.386 UTC [69] LOG:  checkpoint complete: wrote 2498 buffers (1.9%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.169 s, sync=0.237 s, total=0.487 s; sync files=2479, longest=0.017 s, average=0.001 s; distance=17712 kB, estimate=17712 kB
2025-04-17 09:00:52.411 UTC [60] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile:build' failed with return #<Process::Status: pid 1166 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"=>"build", "hook"=>"assets_precompile_build", "cmd"=>["su discourse -c 'bundle exec rake assets:precompile:build'"]}
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.
70f2ceaa8de6662e06cb24304c087499e549d105eaab891ea40bccf16d50bf80

This happens when the server doesn’t have enough memory. How much RAM and/or SWAP this server have?

4 Likes

Total of 4G with about ~2.5G free when I run the launcher

total        used        free      shared  buff/cache   available
Mem:            3911         715        2773           1         683        3196
Swap:              0           0           0

No swap though since I thought it wasn’t necessary on systems with >2GB available. I’ll try adding a swap partition.

1 Like

It seems to work now after setting up thr swap. Thanks so much!

1 Like

Thanks for reporting the result, I’ve made a change for that to happen automatically

3 Likes