# Rebuild goes into a loop

**URL:** https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731
**Category:** Self-hosting
**Created:** [December 2, 2024, 4:47am UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731 "2024-12-02T04:47:25Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![lilacbull](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilacbull/32/437639_2.png) [@lilacbull](https://meta.discourse.org/u/lilacbull)
#### Post date: [December 2, 2024, 4:47am UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/1 "2024-12-02T04:47:26Z")

</div>

Hello, my apologies in advance as I’m relatively new to Discourse.

When I go to the /var/discourse/ directory to run ./launcher rebuild app I have the following loop posted below.

So far the GUI is fine and I can run updates there.

I tried a few Google searches and found this thread outlining a solution. My question is can I also use the git stash and git pull commands to solve my issue with the command line?

> [@Trying to update an old staging instance getting errors about repo changes](https://meta.discourse.org/t/trying-to-update-an-old-staging-instance-getting-errors-about-repo-changes/91717):
>
> So I am in the process of upgrading an old staging instance so that I can do some testing of changes before rolling out to production, and when I run ./launcher rebuild app it goes through the process of downloading latest image, etc. - and then it gives me these errors about doing git pull as part of the rebuild process: $ ./launcher rebuild app Ensuring launcher is up to date Fetching origin Updating Launcher Updating 488fd91..c11d5b0 error: Your local changes to the following files would be …

> [@Trying to update an old staging instance getting errors about repo changes](https://meta.discourse.org/t/trying-to-update-an-old-staging-instance-getting-errors-about-repo-changes/91717/4):
>
> ```plaintext
> cd /var/discourse
> git stash
> git pull
> ./launcher rebuild
> 
> ```

> Ensuring launcher is up to date
> 
> Updating Launcher…
> 
> Updating a1d8d0b..69d7558
> 
> error: Your local changes to the following files would be overwritten by merge:
> 
> templates/web.ssl.template.yml
> 
> Please commit your changes or stash them before you merge.
> 
> Aborting
> 
> failed to update
> 
> Launcher updated, restarting…
> 
> x86\_64 arch detected.
> 
> Ensuring launcher is up to date
> 
> Updating Launcher…
> 
> Updating a1d8d0b..69d7558
> 
> error: Your local changes to the following files would be overwritten by merge:
> 
> templates/web.ssl.template.yml
> 
> Please commit your changes or stash them before you merge.
> 
> Aborting
> 
> failed to update
> 
> Launcher updated, restarting…

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [December 2, 2024, 7:51am UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/2 "2024-12-02T07:51:55Z")

</div>

> [@lilacbull](#):
>
> error: Your local changes to the following files would be overwritten by merge:
> 
> templates/web.ssl.template.yml

Rename `template/web.ssl.template.yml` to some other name (`templates/my-web.ssl.template.yml`) and use this in the `templates:` section of `containers/app.yml`.

Restore its original content with

```plaintext
git restore templates/web.ssl.template.yml

```

---

<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: [December 2, 2024, 6:10pm UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/3 "2024-12-02T18:10:02Z")

</div>

And (probably) a better long-term solution would be to either add those changes to your `app.yml` or to put your template somewhere outside of the `/var/discourse` tree

---

<div class="post-metadata">

### Author: ![lilacbull](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilacbull/32/437639_2.png) [@lilacbull](https://meta.discourse.org/u/lilacbull)
#### Post date: [December 2, 2024, 6:19pm UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/4 "2024-12-02T18:19:34Z")

</div>

Thank you, I did end up altering this file to add an additional client certificate for some additional encryption between the server and Cloudflare.

If follow the procedure to restore the template.yml file, I’ll run a rebuild to see if that solves my loop issue. Can I then make the same changes once more without too much issue? Or will this happen some time down the road and I’d have to do the same procedure?

I did save my original template as a .bak so I had the opportunity to look at the change.

---

<div class="post-metadata">

### Author: ![lilacbull](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilacbull/32/437639_2.png) [@lilacbull](https://meta.discourse.org/u/lilacbull)
#### Post date: [December 2, 2024, 6:20pm UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/5 "2024-12-02T18:20:05Z")

</div>

Ah thank you, I think you answered my follow up question already!

---

<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: [December 2, 2024, 6:22pm UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/6 "2024-12-02T18:22:09Z")

</div>

> [@lilacbull](#):
>
> I think you answered my follow up question already!

Pretty much. 🙂

Here’s another hint:

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916/1):
>
> In order to store Discourse static assets in your Object Storage add this configuration on your app.yml under the `hooks` section:
> 
> ```plaintext
> after_assets_precompile:
> - exec:
> cd: $home
> cmd:
> - sudo -E -u discourse bundle exec rake s3:upload_assets
> - sudo -E -u discourse bundle exec rake s3:expire_missing_assets
> 
> ```

Well, that’s not as good a hint as I’d hoped. . .. Have a look at the changes that get made in [Setup Multisite Configuration with Let's Encrypt and no Reverse Proxy](https://meta.discourse.org/t/setup-multisite-configuration-with-lets-encrypt-and-no-reverse-proxy/175285)

---

<div class="post-metadata">

### Author: ![lilacbull](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilacbull/32/437639_2.png) [@lilacbull](https://meta.discourse.org/u/lilacbull)
#### Post date: [December 2, 2024, 7:22pm UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/7 "2024-12-02T19:22:13Z")

</div>

As I am now, I don’t think I’m able to solve this one on my own. I followed the instructions for a DigitalOcean [standard install](https://meta.discourse.org/t/142537?silent=true).

My original thought process was to study the app.yml file which led me to the web.ssl.template.yml file to begin with.

I wanted to include a cloudflare crt file for additional security.

I looked over the web.ssl.template.yml file and made a change to this section:

> ssl\_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;  
> ssl\_prefer\_server\_ciphers off;
> 
> ```
> ssl_certificate /shared/ssl/ssl.crt;
> ssl_certificate_key /shared/ssl/ssl.key;
> ssl_client_certificate /shared/ssl/cloudflare.crt;
> ssl_verify_client on;
> 
> ssl_session_tickets off;
> ssl_session_timeout 1d;
> ssl_session_cache shared:SSL:1m;
> 
> ```

I dropped the cloudflare.crt file into the /var/discourse/shared/standalone/ssl directory and as far as I could tell everything worked as I intended.

Is there a resource I can refer to do the same with changes to the app.yml file?

---

<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: [December 2, 2024, 7:35pm UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/8 "2024-12-02T19:35:17Z")

</div>

Mostly people don’t use custom certificates anymore. I’m not sure that there is a good reason to do what you’re asking, but you can see [Allow SSL / HTTPS for your Discourse Docker setup](https://meta.discourse.org/t/allow-ssl-https-for-your-discourse-docker-setup/13847)

I think you just want to turn off the orange cloud, get a lets encrypt certificate and turn on the orange cloud. You also want to use the cloudflare template.

See [Using Discourse with Cloudflare: Best Practices](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405)

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [December 2, 2024, 9:43pm UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/9 "2024-12-02T21:43:37Z")

</div>

Hm. I see no concerns against using own files in the `templates` directory, as long their names do not clash with templates, provided by discourse. I find it a convenient way to share config pieces between staging and production server, for example.

---

<div class="post-metadata">

### Author: ![lilacbull](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilacbull/32/437639_2.png) [@lilacbull](https://meta.discourse.org/u/lilacbull)
#### Post date: [December 3, 2024, 1:09am UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/10 "2024-12-03T01:09:48Z")

</div>

Thank you to @thoka and @pfaffman for your time and replies.

I’ve since performed the git restore.

As Jay’s pointed out that people generally don’t use custom certificates anymore, I suppose at this time I don’t see a burning need for it either.

I did another ./launcher rebuild app and the launcher ran without issue.

As an aside I simply input the cloudflare template at the bottom of app.yml as directed, but launcher came up with a syntax error. I removed it and all is fine. I never experienced an issue using Cloudflare without the cloudflare template so I’ll just carry on.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 2, 2025, 1:10am UTC](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/11 "2025-01-02T01:10:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
