# Let's Encrypt does not respect changes to \`DISCOURSE\_DEVELOPER\_EMAILS\`

**URL:** https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118
**Category:** Bug
**Created:** [March 14, 2017, 11:39pm UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118 "2017-03-14T23:39:13Z")
**Posts on this page:** 7
**Page:** 1

<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: [March 14, 2017, 11:39pm UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118/1 "2017-03-14T23:39:13Z")

</div>

tl;dr: If you need to change the address `LETSENCRYPT_ACCOUNT_EMAIL` you need to delete the lets encrypt directory before running it again.

I enabled Let’s Encrypt on a site today. I used a script that copied `DISCOURSE_DEVELOPER_EMAILS` to `LETSENCRYPT_ACCOUNT_EMAIL`. I knew it was a bad idea when I wrote the script, but, you know, I was sure that I would never run it when there was more than one email address in `DISCOURSE_DEVELOPER_EMAILS`. But that’s what I did.

No biggie, I thought, but when I fixed `app.yml` and rebuilt nginx still wouldn’t come up.

From the logs, @tgxworld, it looks like it’s still trying to register with the original three addresses that were in `DISCOURSE_DEVELOPER_EMAILS`.

```plaintext
[Tue Mar 14 22:50:34 UTC 2017] Registering account
[Tue Mar 14 22:50:35 UTC 2017] ESC[1;31;40mRegister account Error: {"type":"urn:acme:error:invali
dEmail","detail":"more than one e-mail address","status": 400}ESC[0m
[Tue Mar 14 22:50:35 UTC 2017] ESC[1;31;40mPlease add '--debug' or '--log' to check more details.
ESC[0m
[Tue Mar 14 22:50:35 UTC 2017] ESC[1;31;40mSee: https://github.com/Neilpang/acme.sh/wiki/How-to-d
ebug-acme.shESC[0m
[Tue Mar 14 22:50:35 UTC 2017] Installing key to:/shared/ssl/forum.SITE.org.key
cat: /shared/letsencrypt/forum.SITE.org/forum.SITE.org.key: No such file or directory
[Tue Mar 14 22:50:35 UTC 2017] Installing full chain to:/shared/ssl/forum.SITE.org.cer
cat: /shared/letsencrypt/forum.SITE.org/fullchain.cer: No such file or directory
[Tue Mar 14 22:50:35 UTC 2017] Run Le_ReloadCmd: sv reload nginx
warning: nginx: unable to open supervise/ok: file does not exist
[Tue Mar 14 22:50:35 UTC 2017] ESC[1;31;40mReload error for :forum.SITE.orgESC[0m

```

and this from the end:

```plaintext
nginx: [emerg] PEM_read_bio_X509_AUX("/shared/ssl/forum.casrai.org.cer") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)

```

Finally, I did a `rm /var/discourse/shared/standalone/letsencrypt` and rebuilt again.

and it worked.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 14, 2017, 11:42pm UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118/2 "2017-03-14T23:42:29Z")

</div>

What do you think @tgxworld?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [March 15, 2017, 12:04am UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118/3 "2017-03-15T00:04:26Z")

</div>

Yep, I see it:

```
- replace:
   filename: /shared/letsencrypt/account.conf
   from: /#ACCOUNT_EMAIL=.+/
   to: |
     ACCOUNT_EMAIL=$$ENV_LETSENCRYPT_ACCOUNT_EMAIL

```

That’ll only work on the first rebuild, because after that it isn’t `#ACCOUNT_EMAIL=` any more. Chuck a `?` after `#` and it’d be fine.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 15, 2017, 12:36am UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118/4 "2017-03-15T00:36:00Z")

</div>

After you mean? Not before.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [March 15, 2017, 1:10am UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118/5 "2017-03-15T01:10:07Z")

</div>

Yes… that’s what I said… :troll:

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 15, 2017, 2:21am UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118/6 "2017-03-15T02:21:48Z")

</div>

Thanks @mpalmer I fixed it in

[https://github.com/discourse/discourse\_docker/commit/210874a02c56f273eacdbd8aaf288facb97a4894](https://github.com/discourse/discourse_docker/commit/210874a02c56f273eacdbd8aaf288facb97a4894)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 15, 2017, 2:21am UTC](https://meta.discourse.org/t/lets-encrypt-does-not-respect-changes-to-discourse-developer-emails/59118/7 "2017-03-15T02:21:53Z")

</div>


