# Defaultish app won't rebuild

**URL:** https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245
**Category:** Self-hosting
**Created:** [August 20, 2019, 3:13am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245 "2019-08-20T03:13:00Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 20, 2019, 3:13am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/1 "2019-08-20T03:13:00Z")

</div>

Hey, I set up the default discourse on a linux machine using this [guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md). It went super smoothly, and the site came up perfectly.

I decided to allow users to connect via facebook, so I went through the facebook instructions linked to from the above link (I’d link again but new users can only post 2 links apparently). That ended up not working, but the site was still up and running (I don’t remember the error I got when trying to log in via facebook).

While going through the facebook docs I saw something about needing to have https enabled, so I started going through [these docs.](https://meta.discourse.org/t/setting-up-https-support-with-lets-encrypt/40709). That all went well until the `./launcher rebuild app`, where I got a postgres error. Which surprised me, because I hadn’t done anything to the postgres config (to the best of my knowledge). The first error is below:

```
INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

```

I didn’t stop the postgres service, but I tried running `service start postgres` and it said it wasn’t installed. So I assume it’s installed automatically some other way than I’m used to. Any ideas on what I could have done wrong? Thanks

my `container/app.yml`:

```
templates:
  - "templates/web.template.yml"
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"

expose:
  - "80:80" # http
  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

  db_shared_buffers: "128MB"

env:
  LANG: en_US.UTF-8
  LETSENCRYPT_ACCOUNT_EMAIL: 'myotheremail@gmail.com'
  UNICORN_WORKERS: 2

  DISCOURSE_HOSTNAME: mysite.com

  DISCOURSE_DEVELOPER_EMAILS: 'myemail@gmail.com'

  DISCOURSE_SMTP_ADDRESS: smtp.gmail.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: myemail@gmail.com
  DISCOURSE_SMTP_PASSWORD: "myPa$$word"

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

run:
  - exec: echo "Beginning of custom commands"
  - exec: echo "End of custom commands"

```

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [August 20, 2019, 6:21pm UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/2 "2019-08-20T18:21:09Z")

</div>

If you were following the official guide, `HTTPS` _should_ have been set up automatically. Note at the very top of the guide you linked to:

> [@Set up HTTPS support with Let's Encrypt](https://meta.discourse.org/t/set-up-https-support-with-lets-encrypt/40709/1):
>
> ❗ This guide is only for existing installs where HTTPS is not enabled. Following the [official setup guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) automatically enables HTTPS by default.

---

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 22, 2019, 3:13am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/3 "2019-08-22T03:13:04Z")

</div>

Yes, that’s correct. And those are the instructions I followed. I did move to the facebook login connect guide first, but I am doubtful that that’s the issue. I went through the guide that you posted, and moved on to https, and now I’m having the issues listed above.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [August 22, 2019, 3:36am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/4 "2019-08-22T03:36:01Z")

</div>

Ok, let’s regroup for a moment.

These two guides are all you should need to follow:

- [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)
- [Configure Facebook login for Discourse](https://meta.discourse.org/t/configuring-facebook-login-for-discourse/13394)

This one you do **not** want to follow since HTTPS is enabled by default:

- [Set up HTTPS support with Let's Encrypt](https://meta.discourse.org/t/setting-up-https-support-with-lets-encrypt/40709/1)

I would start fresh if possible and then report back any errors you receive when trying to log in with Facebook.

---

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 24, 2019, 12:53am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/5 "2019-08-24T00:53:20Z")

</div>

Ok, well when I finished the first guide, the site was up, but it wasn’t https. I assumed it wouldn’t be https until I enabled it. I’ll go back through the instructions, maybe I didn’t understand something, then I’ll report back.

---

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 24, 2019, 1:04am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/6 "2019-08-24T01:04:54Z")

</div>

Ok, I got the app back up, but I don’t see anywhere in these instructions that could possibly setup the site as https as there’s nowhere that involves a cert other than the Let’s Encrypt method at the bottom. What am I missing? Can you point me to where exactly in those instructions it would set up https?

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [August 24, 2019, 1:08am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/7 "2019-08-24T01:08:04Z")

</div>

It’s all done behind the scenes. When you enter your email in the last configuration step:

 ![01%20PM](https://global.discourse-cdn.com/meta/original/3X/6/1/6100b7621999794471aae904cc235effd2e13524.png)

---

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 24, 2019, 1:10am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/8 "2019-08-24T01:10:11Z")

</div>

I bet I hit ENTER to skip and didn’t even realize it. If that’s the case, would it just be best to re-run the config, or go through the let’s encrypt instructions. Keeping in mind, I have a little bit of content on the site right now and I don’t want it wiped. (Thanks again for your help)

---

<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: [August 24, 2019, 1:19am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/9 "2019-08-24T01:19:34Z")

</div>

Just run discourse-setup again and provide an address for let’s encrypt.

---

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 24, 2019, 1:24am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/11 "2019-08-24T01:24:55Z")

</div>

What a fantastic feature. I feel so ridiculous for missing that the first time around. Thanks to both of you, and the team for implementing that.

---

<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: [August 24, 2019, 2:09am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/12 "2019-08-24T02:09:51Z")

</div>

Is there some way to change the words that would have made you understood it sooner?

---

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 24, 2019, 2:40am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/13 "2019-08-24T02:40:16Z")

</div>

I think so. I’m pretty experienced working on servers, but I haven’t been very active since Let’s Encrypt came out, so I just assumed that there would be a section on getting a cert in the documentation if that was something that would work out of the box. Since there wasn’t, I assumed I would have to do it in another step. There’s nothing on that page that evens mentions Let’s Encrypt except for the output from the `./disource-setup` command. Maybe mention under the Edit Discourse Configuration (before the command) mention that if you want https, then you’ll have to put something in the Let’s Encrypt field. I knew to look on that page for https, but there were not https string matches (when I ctrl+f), so I assumed it wasn’t there. I searched for “https” and “cert”, and since it wasn’t there, I assumed it was separate.

And honestly, if I worked on website hosting more frequently, I probably would have seen Let’s Encrypt and immediately known what was going on. Maybe if there was a “what you’ll need” section, that included an email associated with Let’s Encrypt?

I don’t want this to come off as insulting, the documentation is great, and it was human error (my human error) that caused my issue.

---

<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: [August 24, 2019, 3:04am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/14 "2019-08-24T03:04:16Z")

</div>

> [@slimmons](#):
>
> I think so.

Fair enough. What words?

---

<div class="post-metadata">

### Author: ![slimmons](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@slimmons](https://meta.discourse.org/u/slimmons)
#### Post date: [August 24, 2019, 3:09am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/15 "2019-08-24T03:09:28Z")

</div>

I can’t tell if you couldn’t see the rest of my response, but maybe I’ll just put in a PR with the fixes I think would be good. But really just mentioning that the docs have certs handled would be good.

---

<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: [August 24, 2019, 12:54pm UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/16 "2019-08-24T12:54:37Z")

</div>

Ah,! So the install cloud doc doesn’t make it clear? That sounds right.

I’ll have a look at the language at discourse-setup to see if it should make it clearer just what let’s encrypt is. It’s true that it shouldn’t assume that the user knows.

Thanks

---

<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: [March 12, 2023, 3:47am UTC](https://meta.discourse.org/t/defaultish-app-wont-rebuild/126245/17 "2023-03-12T03:47:13Z")

</div>


