# How can i rebuild discourse without changing version?

**URL:** https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233
**Category:** Self-hosting
**Created:** [21 februari 2020 om 09:02 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233 "2020-02-21T09:02:34Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [21 februari 2020 om 09:02 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/1 "2020-02-21T09:02:34Z")

</div>

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.

```plaintext
FAILED
--------------------
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 {} \\+"]}
6269af00c2a4671a6fd2cb13a55bd475743205262bae7f483bf468e4dcacbeed
**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.

```

---

<div class="post-metadata">

### Author: ![Remah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/remah/32/70590_2.png) [@Remah](https://meta.discourse.org/u/Remah)
#### Post date: [21 februari 2020 om 10:44 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/2 "2020-02-21T10:44:49Z")

</div>

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

> [@Rebuilding with a specific version](https://meta.discourse.org/t/rebuilding-with-a-specific-version/125365):
>
> Context: I’m setting up a staging site and I want to have the same version on staging as production so I can test the next update on staging before applying the update to production. How do you ask/get launcher to rebuild with a specific version of discourse?

---

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [21 februari 2020 om 11:06 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/3 "2020-02-21T11:06:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [21 februari 2020 om 13:47 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/4 "2020-02-21T13:47:57Z")

</div>

If you just need to change smtp settings you can

```
./launcher destroy app 
./launcher start app

```

---

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [21 februari 2020 om 16:21 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/5 "2020-02-21T16:21:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [21 februari 2020 om 19:56 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/6 "2020-02-21T19:56:29Z")

</div>

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.”

---

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [22 februari 2020 om 11:03 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/7 "2020-02-22T11:03:45Z")

</div>

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:

```plaintext
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.

> [@Discourse 2.4.0.beta10 Release Notes](https://meta.discourse.org/t/discourse-2-4-0-beta10-release-notes/139327):
>
> New features in 2.4.0.beta10 Bigger emoji When 1-3 emoji exists on their own line, they’re now automatically made larger! Now you can communicate in emoji without needing to squint as much. tadafireworksboomAward a badge to a set of users Badges now support “bulk award”, allowing admins to upload a list of user emails which will all be granted a badge. For full details, see MaxMind DB downloads now require a license key Discourse uses the free MaxMind GeoLite2 IP database to provide l…

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](https://meta.discourse.org/uploads/short-url/lmtpCk8qdDBKKICba4nC9IgibGq.txt) (127.5 KB)

---

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [4 maart 2020 om 08:51 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/8 "2020-03-04T08:51:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4 maart 2020 om 13:42 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/9 "2020-03-04T13:42:17Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [4 maart 2020 om 20:15 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/10 "2020-03-04T20:15:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [5 februari 2021 om 10:09 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/11 "2021-02-05T10:09:09Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Pekkanen](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Pekkanen](https://meta.discourse.org/u/Pekkanen)
#### Post date: [5 februari 2021 om 14:53 UTC](https://meta.discourse.org/t/how-can-i-rebuild-discourse-without-changing-version/142233/12 "2021-02-05T14:53:02Z")

</div>

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
