Update Fails with Unexpected Error During Rebuild

Hi Everyone,

I’m stuck with a Discourse update issue. The rebuild command fails, and I can’t complete the update. It’s related to the bundle install step…

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --retry 3 --jobs 4' failed with return #<Process::Status: pid 6677 exit 5>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle config --local deployment true'", "su discourse -c 'bundle install --retry 3 --jobs 4'"]}
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
bootstrap failed with exit code 5

but I’m unsure how to fix it. Any advice?

Thanks for any pointers!

Please post the full log (or at least earlier errors), as just that chunk doesn’t mean much on its own.

1 Like

You might try without the discourse-formatting-toolbar

Yes, I removed that plugin along with the rest, but unfortunately, the issue persists.

After stripping down almost all the plugins, I’ve appended the latest output from running ./discourse-doctor, and the problem remains. I wonder if I should also consider removing some of the templates or if the error might be elsewhere. Everything was functioning smoothly until I attempted to update, and now the site is down. Here’s the additional text from the ./discourse-doctor output, which may shed more light on the issue:

2023-12-14 22:38:53.291 UTC [42] LOG: database system is shut down
11:14 Mi Dec 2023 22:38:53.536 +0000 Saved on disk
11:14 Mi Dec 2023 22:38:53.346 # Redis is now ready to exit, bye bye...

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --retry 3 --jobs 4' failed with return #<Process::Status: pid 518 exit 5>
Location of failure: /usr/local/lib/ruby/gems/2.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle config --local deployment true'", "su discourse -c 'bundle config --local without \"development test\"'", "su discourse -c 'bundle install --retry 3 --jobs 4'"]}
** 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.
==================== END REBUILD LOG ====================
Failed to rebuild app.

Checking your domain name...
Connection to forospyware.com succeeded.
You should probably remove any non-standard plugins and rebuild.
Attempting to restart existing container...
x86_64 arch detected.

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: driver failed programming external connectivity on endpoint app (1a8bb1f1f3267284b55ed1620db877010454d9932112d71de80bac3e5ff7d7): Error starting userland proxy: listen tcp bind: address already in use
Error: failed to start containers: app
Failed to restart the container.

==================== PLUGINS ====================
- git clone https://github.com/discourse/docker_manager.git
No non-official plugins detected.

See https://github.com/discourse/discourse/blob/main/lib/plugin/metadata.rb for the official list.

==================== DISCOURSE VERSION ====================
Discourse version at forospyware.com: NOT FOUND
Discourse version at localhost: NOT FOUND

==================== MEMORY INFORMATION ====================
RAM (MB): 8174

total used free shared buff/cache available
Mem: 7983 195 4275 80 3512 7326
Swap: 0 0 0

==================== DISK SPACE CHECK ====================
-- OS Disk Space
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 155G 107G 49G 69% /

==================== DISK INFORMATION ====================
Disk /dev/vda: 160 GiB, 171798691840 bytes, 335544320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 603625F3-7AE2-40CB-B05E-08D7EAD257E4

Device Start End Sectors Size Type
/dev/vda1 227328 335544286 335316959 159.9G Linux filesystem
/dev/vda14 2048 10239 8192 4M BIOS boot
/dev/vda15 10240 227327 217088 106M Microsoft basic data

Partition table entries are not in disk order.
==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Or just send a test message to yourself.
Email address for mail test? ('n' to skip) [ ]: n
Mail test skipped.
Replacing: Sending mail to

==================== DONE! ====================
You can examine the output of this script with
LESS=-Ri less /tmp/discourse-debug.txt

BUT FIRST, make sure that you know the first three commands below!!!

Commands to know when viewing the file with the above command (called 'less'):
q -- quit
/ -- search for the word 'error'
n -- search for the next occurrence
N -- go to the

You need to share the first part of the build log. The part that includes the bundle install line.

Do you mean this part? - sorry, moving around and seeing all the code with the DigitalOcean console is very difficult.

Could you look through the long and provide places where there are errors? The one at the end shouldn’t be the only one.

If that’s too much of a pain, providing the whole log works too.

Looks like this was the critical fail:

I, [2023-12-14T22:38:19.544278 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --retry 3 --jobs 4'
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/usr/local/bin/ruby extconf.rb
  -- tar zxvfo msgpack-1.1.0.tar.gz
  -- env CFLAGS=nil LDFLAGS=nil CC=nil
-- ./configure --disable-dependency-tracking --disable-shared --with-pic
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
extconf.rb:6:in `sys': ./configure --disable-dependency-tracking
--disable-shared --with-pic
failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
	from extconf.rb:42:in `block (2 levels) in <main>'
	from extconf.rb:34:in `chdir'
	from extconf.rb:34:in `block in <main>'
	from extconf.rb:30:in `chdir'
	from extconf.rb:30:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can
be found here:


extconf failed, exit code 1

Gem files will remain installed in
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0 for inspection.
Results logged to

  /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:120:in `run'
/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:222:in `block in
  /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:219:in `each'
`block in worker_pool'
`block in process_queue'
`block (2 levels) in create_threads'

An error occurred while installing rbtrace (0.5.0), and Bundler cannot continue.

Could you provide that log file? (/var/www/discourse/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/rbtrace-0.5.0/mkmf.log)

Jay had the same issue Rebuild failure: "extconf failed, exit code 1" -- due to old Docker?, but I don’t know if he figured out the issue ultimately.

@TroyaNO Just in case, can you try to type git pull before trying again ./launcher rebuild app?

1 Like

I decided that it was an old Docker, though that didn’t really make sense.

But I bet this has been on the same vm since 2018 and the os is out of date.

So what I would do is spin up a new droplet and Move a Discourse site to another VPS with rsync.

1 Like