Installatie produceerde nul-byte sleutel en geen certificaat

AI-generated summary

Users reported a bug during Discourse installation where Let’s Encrypt failed to generate valid SSL certificates, resulting in zero-byte key files and ‘connection refused’ errors when accessing the site. darbcal first documented the issue after following the Digital Ocean installation guide, noting empty .key files and acme.sh errors. Others, including dmitchell and jomaxro, confirmed identical behavior. A workaround was found by dmitchell — setting Let’s Encrypt as the default CA via ./acme.sh --set-default-ca --server letsencrypt and updating account.conf with DEFAULT_CA="https://acme-v02.api.letsencrypt.org/directory" — which worked for some, including sethm. However, darbcal reported it didn’t work for them. The issue was acknowledged as a bug by pfaffman, and Falco confirmed a fix was being implemented. The fix was later merged in commit 2909a16 Falco, resolving the problem for users who rebuilt their app after updating. itsbhanusharma questioned whether the CA should be set before install, and codinghorror apologized for the issue and thanked users for reporting it. pfaffman reminded users to git pull and rebuild to apply the fix.

I installed Discourse by following installation instructions at discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub. (Digital Ocean droplet)

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

Some items of interests:

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
./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?

1 like

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

Edit: I had the same error with them.

Thanks Seth, I do not.

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

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

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

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.

1 like

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

1 like

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

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

And then rebuild the app.

2 likes

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

1 like

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

1 like

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:

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

Not sure which one did the trick!

3 likes

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

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
1 like

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

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

Working on a fix right now, hang tight

2 likes

Working now for me after I rebuilt the app.

1 like

This should be all fixed now with

https://github.com/discourse/discourse_docker/commit/2909a162475ca0e5cbdb69059ff0254c820b1963

5 likes

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

1 like

Sorry about that and thanks for the report!

1 like

Did you git pull and rebuild?

2 likes

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