Build fails due to ruby version mismatch

After some days of using
./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only without issue
I ran into issues after trying to use the rails console to set SiteSetting.can_permanently_delete = true
using ./launcher enter web_only then rails c

Question: Is the rails console accessed differently in separate container mode?

After failing to get a successful rebuild and bootstrap I rolled the server back a couple of days prior to implementing AI stuff. No joy!
The bootstrap method fails with:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3' failed with return #<Process::Status: pid 465 exit 18>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.4.0/lib/pups/exec_command.rb:138:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'", "su discourse -c 'bundle clean'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name cache -not -path \"*/gems/*\" -type d -exec rm -rf {} +'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +'"]}
bootstrap failed with exit code 18
** 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.
aee0f5c110bf8ce78f05c138a78712b4a0116fe6662c998b2f29800715036091

./launcher rebuild web_only errors as well

docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint web_only (06b7b1f7f6b476adac20a11a55de776d7350e837407a6c7a6ba582c917f6dd73): Bind for 0.0.0.0:80

After updating Docker Manager from Admin I get

You are running an old version of the Discourse image
Updates via the web UI are disabled until you run the latest image. To do so log in to your server using SSH and run:

  cd /var/discourse
  ./launcher rebuild app

Question: You guys have any ideas on what is going on?

Hereโ€™s the error that causes the build to fail:

[2026-02-17T16:51:13.376629 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

You need to scroll up to find the error.

3 Likes

Yes, I have done that but never see anything helpful.
Here is latest.
exitcode18.txt (43.5 KB)

Hereโ€™s the error:

[2026-02-17T16:51:13.376629 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

Do you have discourse Docker pinned to an old version? Or, it could be a bug, but it seems in) unlikely that such a bug would pass the build test.

Thanks Jay. I saw that but odd messages are not that uncommon with successful builds.

No, followed the OP as mentioned.

@pfaffman Thanks for the move!

1 Like

Can you pull /var/discourse? The rebuild should be done using base image 2.0.20260209-1300

1 Like

Thanks for jumping in @supermathie

2.0.20260209-1300 is used
from fresh ./launcher rebuild web_only

Status: Downloaded newer image for discourse/base:2.0.20260209-1300
docker.io/discourse/base:2.0.20260209-1300
Ensuring launcher is up to date
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 web_only
web_only
2.0.20260209-1300: Pulling from discourse/base
Digest: sha256:50d2dae489a9c9916c3d50d880f7f1282fcbe179339b60a8947ab135c1f1f9bf
Status: Image is up to date for discourse/base:2.0.20260209-1300
docker.io/discourse/base:2.0.20260209-1300

end of build

docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint web_only (9e391a36bdc1a80a6b993a466ffdba25337ce70f1fe74f2b5d8aaca75585322b): Bind for 0.0.0.0:80 failed: port is already allocated

failed to set up container networking.txt (74.3 KB)

Edit
I am thinking the original sin started with the conversion to two containers.

something on your server is already using port 80 and needs to be stopped

But you said that it had been working and youโ€™d done several rebuilds.

Discourse is the only thing on the server

I did and do :grinning_face:

There are three rebuild options in the original post. The one I reference has never worked .i.e. caused failure

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1310/docker-proxy
tcp6       0      0 :::80                   :::*                    LISTEN      1316/docker-proxy

Checking two other instances running separate containersโ€ฆ the message @pfaffman pointed out

Same result with ./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only

Already up to date
โ•ญ Warning โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                                              โ”‚
โ”‚   Ignored build scripts: @swc/core@1.15.7, core-js@2.6.12, core-js@3.47.0,   โ”‚
โ”‚   esbuild@0.25.12, esbuild@0.27.1, lefthook@2.1.0.                           โ”‚
โ”‚   Run "pnpm approve-builds" to pick which dependencies should be allowed     โ”‚
โ”‚   to run scripts.                                                            โ”‚
โ”‚                                                                              โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
I, [2026-02-17T21:07:23.811289 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

Yeah. That wonโ€™t work. It has never worked. I donโ€™t know how someone suggested that it would. I donโ€™t know how I didnโ€™t notice that someone suggested that it would. And the point of the two-container setup, is that you mostly never upgrade data.

If you need to upgrade data, then you need to shutdown web only and then rebuild data, then web_only. I updated the OP.

If you get port conflict errors then itโ€™s likely because when docker restarted it first restarted the old app container and itโ€™s what is grabbing the port. You can check with

docker ps

and see if app is running. You hope that it is, as that will explain the port issue.

You probably need to

 docker stop app; docker rm app
2 Likes