Failed to renew expired certificate

Please show output of:
sudo /opt/bitnami/letsencrypt/lego list

1 Like

Output = No certificates found

1 Like

What do you mean i am new here ..

Please show the output of:
sudo /opt/bitnami/letsencrypt/lego --path="/opt/bitnami/letsencrypt" list

1 Like

Found the following certs:
Certificate Name: example.com
Domains: example.com
Expiry Date: 2020-12-24 19:14:40 +0000 UTC
Certificate Path: /opt/bitnami/letsencrypt/certificates/example.com.crt

Certificate Name: example.com
Domains: example.com
Expiry Date: 2021-03-27 08:16:08 +0000 UTC
Certificate Path: /opt/bitnami/letsencrypt/certificates/example.com.crt

1 Like

Interesting... two certs both covering the same name!
One has uppercase "M" in the path.

1 Like

I don't know how to get completely out of this "mess".
I would try copying the new one over the old one.
But even if that works, it will fail again in a few months time.

1 Like

Yes it's the problem right? see the second one is valid, What is the solution do you think

1 Like

I would copy the good one over the bad one (for now):

cp /opt/bitnami/letsencrypt/certificates/example.com.crt /opt/bitnami/letsencrypt/certificates/example.com.crt

then
sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/ctlscript.sh start

1 Like

Delete the example.com certificate not solve this problem?

1 Like

It may still be looking for that name (with the upper case M)
But you can try that.
There are two duplicated files with M/m in that folder.
And a few that only have the M.
Be careful not to delete any of the single files.

1 Like

In other words, try renaming all the M to m.
If there are duplicates, then delete the one with M.

1 Like

Can't rename it due the duplicates, I will delete it after 4 hours because i have the root access in my home only i want to take cope of files also before deleting ..

1 Like

Rename all the ones that can be renamed.
Delete the M ones that are duplicates and can't be renamed.

In the end all should show m (none with M).

1 Like

Sure :rose:
I hope that success :upside_down_face:

2 Likes

Hi @rg305
I delete the file and i got this error massage:

nginx: [emerg] cannot load certificate "/opt/bitnami/nginx/conf/example.com.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/opt/bitnami/nginx/conf/example.com.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
/opt/bitnami/nginx/scripts/ctl.sh: 77: [: Illegal number:
/opt/bitnami/nginx/scripts/ctl.sh : Nginx could not be started

1 Like

I solve it :star_struck:
I change the m to M
Next renew i must use M for renew i hop that problem not happened again ..

I have questions about auto renew, I use the below code in auto renew file but i don't know when it will renewed, can i get a explain for that plz .. thanks for big support:

sudo /opt/bitnami/letsencrypt/lego --tls --email="****@mail.com" --domains="example.com" --path="/opt/bitnami/letsencrypt" renew --days 90

3 Likes

Hello @SAYED_ALI,

If you use --days 90 your certificate will be renewed every time the command runs and you will hit rate limits so use --days 30 or don't use it and lego will default to 30 days.

Cheers,
sahsanu

1 Like

Hi @sahsanu

Thats mean i didn't use the --days better, and it will automatically renewed before 30 days from expire right?

Thanks

1 Like

I think Bitnami documentation is to blame for the --days 90:

Step 5: Renew The Let’s Encrypt Certificate

Shows:

sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/letsencrypt/lego --tls --email="EMAIL-ADDRESS" --domains="DOMAIN" --path="/opt/bitnami/letsencrypt" renew --days 90
sudo /opt/bitnami/ctlscript.sh start
3 Likes