# Installation produced zero byte key and no certificate

**URL:** https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885
**Category:** Bug
**Created:** [June 15, 2021, 11:45am UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885 "2021-06-15T11:45:00Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![darbcal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darbcal/32/224223_2.png) [@darbcal](https://meta.discourse.org/u/darbcal)
#### Post date: [June 15, 2021, 11:45am UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/1 "2021-06-15T11:45:00Z")

</div>

I installed Discourse by following installation instructions at [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md). (Digital Ocean droplet)

After installation, I tried to visit the site in a browser and I get ‘connection refused’.

Some items of interests:

```plaintext
ls -l /var/discourse/shared/standalone/ssl/
-rw-r--r-- 1 root root 0 Jun 15 11:26 forums.MYDOMAIN.com.key
-rw-r--r-- 1 root root 0 Jun 15 11:26 forums.MYDOMAIN.com_ecc.key

```

```plaintext
./launcher logs app | grep letsencrypt
run-parts: executing /etc/runit/1.d/ **letsencrypt**
[Tue 15 Jun 2021 11:26:09 AM UTC] **Please check log file for more details: /shared/letsencrypt** /acme.sh.log
[Tue 15 Jun 2021 11:26:09 AM UTC] **Please check log file for more details: /shared/letsencrypt** /acme.sh.log
cat: /shared/ **letsencrypt** /forums.MYDOMAIN.com/forums.MYDOMAIN.com.key: No such file or directory
[Tue 15 Jun 2021 11:26:10 AM UTC] **Please check log file for more details: /shared/letsencrypt** /acme.sh.log
[Tue 15 Jun 2021 11:26:10 AM UTC] **Please check log file for more details: /shared/letsencrypt** /acme.sh.log
cat: /shared/ **letsencrypt** /forums.MYDOMAIN.com_ecc/forums.MYDOMAIN.com.key: No such file or directory

```

I’ve ran the installation multiple times with the same result. Any suggestions for my next step?

---

<div class="post-metadata">

### Author: ![sethm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sethm/32/60326_2.png) [@sethm](https://meta.discourse.org/u/sethm)
#### Post date: [June 15, 2021, 12:06pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/2 "2021-06-15T12:06:05Z")

</div>

Shot in the dark, but you wouldn’t happen to host a site with Netlify?

Edit: I had the same error with them.

---

<div class="post-metadata">

### Author: ![darbcal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darbcal/32/224223_2.png) [@darbcal](https://meta.discourse.org/u/darbcal)
#### Post date: [June 15, 2021, 12:13pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/3 "2021-06-15T12:13:00Z")

</div>

Thanks Seth, I do not.

---

<div class="post-metadata">

### Author: ![darbcal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darbcal/32/224223_2.png) [@darbcal](https://meta.discourse.org/u/darbcal)
#### Post date: [June 16, 2021, 10:09am UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/4 "2021-06-16T10:09:04Z")

</div>

Rebuilding the app with SSL commented out works. Thus the error is in the letsencrypt portion. I don’t believe I am hitting a limit because when I look up certs, none are listed for this site.

Running on command line does not give me any more information

```plaintext
LE_WORKING_DIR=/shared/letsencrypt /shared/letsencrypt/acme.sh --issue -d community.grazinggrass.com -k 4096 -w /var/www/discourse/public --debug

```

When I added --server letsencrypt, I get the following error

```plaintext
MYDOMAIN.com:Verify error:Fetching http://MYDOMAIN.com/.well-known/acme-challenge/xDUsp83k9OJ-FjyBhihad1_WH2ixnliN7rU0JBUp7Zg: Connection refused

```

---

<div class="post-metadata">

### Author: ![dmitchell](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dmitchell](https://meta.discourse.org/u/dmitchell)
#### Post date: [June 16, 2021, 1:15pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/6 "2021-06-16T13:15:00Z")

</div>

Exactly the same problem here! Tried registering beforehand by running the command `acme.sh --register-account -m my@example.com` with my email, seems to have registered but reinstalling discourse gives exactly the same error.

---

<div class="post-metadata">

### Author: ![darbcal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darbcal/32/224223_2.png) [@darbcal](https://meta.discourse.org/u/darbcal)
#### Post date: [June 16, 2021, 1:16pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/7 "2021-06-16T13:16:18Z")

</div>

I did the same thing, @dmitchell . No change.

---

<div class="post-metadata">

### Author: ![dmitchell](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dmitchell](https://meta.discourse.org/u/dmitchell)
#### Post date: [June 16, 2021, 2:55pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/8 "2021-06-16T14:55:21Z")

</div>

Managed to get this working by forcing letsencrypt as default CA for the `acme.sh` script. Running this seems to do it:

```plaintext
./acme.sh --set-default-ca --server letsencrypt

```

And then rebuild the app.

---

<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: [June 16, 2021, 3:21pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/9 "2021-06-16T15:21:23Z")

</div>

This sounds like a bug and there have been other reports and you have a solution. I’ve not checked myself yet, but I’m moving this to #Contribute > Bug

---

<div class="post-metadata">

### Author: ![darbcal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darbcal/32/224223_2.png) [@darbcal](https://meta.discourse.org/u/darbcal)
#### Post date: [June 16, 2021, 4:02pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/10 "2021-06-16T16:02:48Z")

</div>

> [@dmitchell](#):
>
> `./acme.sh --set-default-ca --server letsencrypt`

It’s not working for me. Maybe I’m missing a step?

---

<div class="post-metadata">

### Author: ![dmitchell](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dmitchell](https://meta.discourse.org/u/dmitchell)
#### Post date: [June 16, 2021, 4:06pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/11 "2021-06-16T16:06:05Z")

</div>

I ran it on `/var/discourse/shared/standalone/letsencrypt`, but at the same time I also updated `account.conf` on the same directory, with the option:

```plaintext
DEFAULT_CA="https://acme-v02.api.letsencrypt.org/directory"

```

Not sure which one did the trick!

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [June 16, 2021, 4:35pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/13 "2021-06-16T16:35:15Z")

</div>

I can reproduce this. Just did an install on DO and am seeing connection refused. Can also confirm the zero byte key:

```plaintext
root@jomaxro-letsencrypt-testing:/var/discourse# ls -l /var/discourse/shared/standalone/ssl/
total 0
-rw-r--r-- 1 root root 0 Jun 16 16:31 le-testing.demo-by-discourse.com.key
-rw-r--r-- 1 root root 0 Jun 16 16:31 le-testing.demo-by-discourse.com_ecc.key

```

---

<div class="post-metadata">

### Author: ![sethm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sethm/32/60326_2.png) [@sethm](https://meta.discourse.org/u/sethm)
#### Post date: [June 16, 2021, 4:35pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/14 "2021-06-16T16:35:38Z")

</div>

I hit the heart, but I just want to confirm that your solution worked for me too.

---

<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: [June 16, 2021, 4:56pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/16 "2021-06-16T16:56:04Z")

</div>

It looks like it should be a quick fix for someone who’s good at such.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 16, 2021, 5:17pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/17 "2021-06-16T17:17:45Z")

</div>

Working on a fix right now, hang tight

---

<div class="post-metadata">

### Author: ![Hidden](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hidden/32/224451_2.png) [@Hidden](https://meta.discourse.org/u/Hidden)
#### Post date: [June 16, 2021, 5:52pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/19 "2021-06-16T17:52:02Z")

</div>

Working now for me after I rebuilt the app.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 16, 2021, 6:02pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/20 "2021-06-16T18:02:06Z")

</div>

This should be all fixed now with

[https://github.com/discourse/discourse\_docker/commit/2909a162475ca0e5cbdb69059ff0254c820b1963](https://github.com/discourse/discourse_docker/commit/2909a162475ca0e5cbdb69059ff0254c820b1963)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [June 16, 2021, 6:26pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/21 "2021-06-16T18:26:07Z")

</div>

shouldn’t the CA be set before the install command?

---

<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: [June 17, 2021, 1:46am UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/22 "2021-06-17T01:46:53Z")

</div>

Sorry about that and thanks for the report!

---

<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: [June 17, 2021, 7:38pm UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/24 "2021-06-17T19:38:27Z")

</div>

Did you git pull and rebuild?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 19, 2021, 8:00am UTC](https://meta.discourse.org/t/installation-produced-zero-byte-key-and-no-certificate/193885/25 "2021-06-19T08:00:36Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
