How can i rebuild discourse without changing version?

I need to update the smtp settings in app.yml, but I do not want to change the version of discourse.

When I specify a version via the version tag, the rebuild fails with the error below. I am currently on version 2.4.0.beta8.

Pups::ExecError: cd /var/www/discourse && find /var/www/discourse ! -user discourse -exec chown discourse {} \+ failed with return #<Process::Status: pid 336 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"web", "cmd"=>["gem update bundler", "find $home ! -user discourse -exec chown discourse {} \\+"]}
** 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.

1 Like

This comes up every year and probably should have a #howto topic. I just searched for specific version:

1 Like

Yes, difference here is that i am using the version tag in the yml, but get an error when rebuilding

1 Like

If you just need to change smtp settings you can

./launcher destroy app 
./launcher start app

ok, so that will read the yml even if it does not rebuild, sounds good. While that will fix my urgent issue, i am still intrested in why version does not work.

You said that you get “an error”. That means that you did something wrong. My best guess is a YML formatting error, but without knowing what the error was, there is really no way to know.

Sorry, “please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.”


Yes, I can see that the information i gave in the post was not detailed enough. I do not think it is a formatting error, since the yml works fine without the version tag.

I tested some more, and it seems like whatever bug I encountered does not trigger in version 10 and 11, but does trigger in version 4 to 9.

I can only find two errors in the print, and i think they are expected:

2020-02-22 10:42:33.410 UTC [62] postgres@postgres ERROR:  database "discourse" already exists

2020-02-22 10:42:33.533 UTC [73] postgres@discourse ERROR:  role "discourse" already exists

I looked at the release notes for version 10, and did not find a reference to a fix related to this.

Its good that it is fixed, and with your work around for the smpt settings (will test it on monday, dont want to mess with the production server during the weekend) there is no urgent need from me, but it would be good to know if there is an unknown error that the tests will not catch, and that may return, if it was ‘fixed’ by accident and not by a targeted change. I guess i want to know how stable the version function can be expected to be in the future.

This is a dump of the output from a run with v2.4.0.beta9 as target version.
dump_disco_version_error.txt (127.5 KB)

I finally found time to test this, and it did not work. I can see that it prints the correct pw when the app starts, but emails still fail due to access denied.

Hmm. I’m sure that it used to work. I have seen some other settings not get pushed to the config file. I’m not sure if it’s considered a bug.

It could also be that I am using an old version, so it may or may not work in the latest version. I just wanted to update with my findings.

I had reason to get back to this, seems to me like version works for branches, but not tags. I assume its because the launcher does not fetch all the tags first, `but i don’t know. Is there a way to edit the launcher scripts?

Finally figured out what goes wrong, the discourse_docker repo and the discourse repo depend on each other, so a specific version of discourse can only be installed by a specific version of the discourse_docker repo. Unfortunatly there are no tags in the discourse_docker repo, so finding which sha should be used to install a specific version is not easy. Nice to get some closure at least. I will start taking notes on this for the installs i make in the future

1 Like