Help deploying older versions of Discourse

There should be an error here, I tried to pull v3.6.0.beta2 via a tag, but encountered the following error:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  git fetch --tags --prune-tags --prune --force origin
  if [[ $(git symbolic-ref --short HEAD) == v3.6.0.beta2 ]] ; then
      git pull
  else
      git -c advice.detachedHead=false checkout v3.6.0.beta2
  fi
' failed with return #<Process::Status: pid 146 exit 128>
Location of failure: /usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups/exec_command.rb:138:in `Pups::ExecCommand#spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd'=>["sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\\n  set -o errexit\\n  git fetch --tags --prune-tags --prune --force origin\\n  if [[ $(git symbolic-ref --short HEAD) == $version ]] ; then\\n      git pull\\n  else\\n      git -c advice.detachedHead=false checkout $version\\n  fi\\n'", "sudo -H -E -u discourse git config user.discourse-version $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p                    /shared/log/rails", "bash -c \\"touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\\"", "bash -c \\"ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\\"", "bash -c \\"mkdir -p           /shared/{uploads,backups}\\"", "bash -c \\"ln    -s           /shared/{uploads,backups} $home/public\\"", "bash -c \\"mkdir -p           /shared/tmp/{backups,restores}\\"", "bash -c \\"ln    -s           /shared/tmp/{backups,restores} $home/tmp\\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp", "[ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete"]}
bootstrap failed with exit code 128
** 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.
adc8ef45e9ae880827c9294dbbf73dfe9ab413a050c83fe3f4722c2911876ce2

version only supports branches, not tags!

What is correct is:

params:
  version: release/2025.11

As for why I want to pull release/2025.11, it’s because the current production environment is on a version close to that, and I want to upgrade, but I’m afraid of potential issues. Furthermore, the audit process does not allow me to perform upgrades directly; I must first validate the upgrade process (from release/2025.11 to release/2026.1) in the test environment before proceeding in production. Although this is somewhat tedious, it is indeed the best choice for a correct process. Thus, I had to look for a way to pull a specific branch or tag here.

Sorry for saying so much unnecessary stuff. Fortunately, I have now found a passable solution. Thank you everyone.

I continue to update on other impacts caused by this modification:

Installing a specific branch was successful, but attempting to verify an upgrade from this branch failed. This is because the latest update is not detected on the update page, preventing the update operation from being performed on the page.

1 Like

Continuing from the previous topic, a new issue has been identified. When the local codebase is outdated, it can cause frontend compilation failures or other errors. Therefore, before making any modifications, the local codebase must be updated to the latest version.

# If you have previously modified the local codebase, please stash your changes first
# git stash

# Update to the latest version
git pull

# Reapply the stashed changes, or re-edit the corresponding configuration files
# git stash pop

Only after updating the local repository to the latest version can the installation proceed smoothly to build the specified branch as per the previous steps.

The local codebase referred to here is: https://github.com/discourse/discourse_docker.git

That is, the codebase after a standard installation.

Finally, let’s summarize.

Our requirement is: install a specific version

  1. Update the local code repository https://github.com/discourse/discourse_docker.git
# Enter the project root directory
cd /var/discourse
# Update to the latest version
git pull
  1. Modify the version to be specified

Edit templates/web.template.yml

params:
  version: release/2026.1
  1. Rebuild
./launcher rebuild app

After making this change, the steps for future updates or upgrades are to first update the local code repository. However, since we have modified the local code, the update might fail. Therefore, it is highly likely that you will need to stash your local changes using git stash, then run git pull to ensure the local repository is up to date. After that, modify the branch you want to upgrade or specify, and finally rebuild.

I think it would be very unusual to configure a specific version, rather than a flavour/stream/tag, like latest or stable. I’m actually no longer sure what tags are normal and available and useful with this system.

Have you taken a look at Configure a supported tracking branch to get Discourse software updates ? Maybe it helps for understanding which tags are useful

Yes, for ordinary users, the default latest is sufficient. However, for my scenario, I have no choice but to investigate how to use a specific version. I can’t just tell the boss: “Oh, I’m sorry, Discourse doesn’t currently support checking out a specific version; we can only update to the latest version.”

This post is very helpful; I will take a careful look at it. Thank you.

I hadn’t seen that - thanks. Looks like we should be using latest/release/esr now. I see my own (old) app.yml picks up the default by being commented out:

  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

version currently does not support tags. To add support, the build script must be modified. The best practice would originally be:

params:
  version: esr

However, currently, it must be changed to:

params:
  version: release/2026.1
1 Like

Interesting. Even before the new versioning strategy, beta had been a tag instead of a branch for quite a while: Upcoming changes to the beta branch of Discourse

It’s me, I’m also confused, but the current build code indeed cannot use tags. This shouldn’t be the case.

1 Like

version: release/2026.1 should work fine. If you want to take advantage of the new overlapping support periods on versions, then this is the correct way to do it. (but of course, you must to remember to update manually before 2026.1 reaches its end-of-life)

version: esr should also work. The system is designed to support tags. It is implemented as git checkout $version.

You should not make this change in web.template.yml. You should make it in your site-specific containers/app.yml

4 Likes