eugene-khyst/letsencrypt-docker-compose

cannot load certificate "/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem":

lattice0 opened this issue · 8 comments

nginx_1    | Waiting for Let's Encrypt certificates for something.com
nginx_1    | 2022/02/25 16:39:15 [emerg] 1#1: cannot load certificate "/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx_1    | nginx: [emerg] cannot load certificate "/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
devcomanda_nginx_1 exited with code 1

DOMAINS=something.com
CERTBOT_EMAILS=something@something.com
CERTBOT_TEST_CERT=1
CERTBOT_RSA_KEY_SIZE=4096

I am getting the same error:

nginx_1 | Waiting for Let's Encrypt certificates for xx.com
nginx_1 | 2022/03/03 07:57:04 [emerg] 1#1: cannot load certificate "/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx_1 | nginx: [emerg] cannot load certificate "/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/dummy/test1.devcomanda.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
devcomanda_nginx_1 exited with code 1
certbot_1 | Waiting for nginx to start...
devcomanda_nginx_1 exited with code 1
devcomanda_nginx_1 exited with code 1
certbot_1 | nc: bad address 'nginx'
certbot_1 | Waiting for nginx to start...

Working on a fix

Would be nice if things didn't have the devcomanda name also, but a generic name like website

Same error, any fix here?

I've almost finished the development of a new version. It will fix this problem and slightly simplify the solution overall. I plan to release it within 24 hours.

@LucasZanella , @tamoj32 , @safead , the fix is merged. Please, pull the lates changes.
Now, everything you need to use your own domains is to properly specify your domains and email in the config.env.
Anyway, read the updated instructions in the README.md.

Thanks, it worked

However, this step

Step 3 - Build images and start containers

docker-compose up -d --build

should have no -d so we can inspect errors as it's in the test phase. I had one but it was because I didn't have the www CNAME. Also I'd make the Readme significantly smaller as people looking for this level of simplicity of dockerized nginx + certbot often wants the fastest setup possible. The readme makes it look like a 10 min setup when it's actually a 2 min setup if you already have the recors setted.

@lattice0 , thanks for the feedback. I've changed the README.md according to your comment.