Renewal fails because of removed subdomain

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: nerd.cx

I ran this command: certbot renew

It produced this output: Failed to renew certificate nerd.cx with error: Some challenges have failed.

My web server is (include version): Apache/2.4.62 (Debian)

The operating system my web server runs on is (include version): trixie/sid

My hosting provider, if applicable, is: OVH

I can login to a root shell on my machine (yes or no, or I don't know): yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 2.11.0

More detail:
I had a subdomain set up for this domain, (patrick.nerd.cx), but I am no longer using it. It is not mentioned in /etc/letsencrypt, or /etc/apache2, but it is listed in "certbot certificates", which is probably causing the problem.

I ran "certbot delete --cert-name patrick.nerd.cx" and I get a no certificate found error.

Any help would be appreciated. Thanks!

Hi @willyyam, and welcome to the LE community forum :slight_smile:

Please show that output.

2 Likes

root@witteman:/etc/letsencrypt# certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log


Found the following certs:
Certificate Name: nerd.cx
Serial Number: 3eb43ae2f0c13f81cce8b842254026ac901
Key Type: RSA
Domains: nerd.cx patrick.nerd.cx
Expiry Date: 2024-10-06 07:06:10+00:00 (VALID: 5 days)
Certificate Path: /etc/letsencrypt/live/nerd.cx/fullchain.pem
Private Key Path: /etc/letsencrypt/live/nerd.cx/privkey.pem

The error you got when using --cert-name patrick.nerd.cx" is to be expected: no such certificate is known to Certbot.

Unfortunately, Certbot does not have a proper way to add or delete a hostname to or from a certificate.

There are two solutions to your situation:

  • re-run Certbot the same way as you did the first time (currently I don't know which options you used, so I can't provide the exact command), but don't add patrick.nerd.cx as a hostname;
  • run certbot renew with the --allow-subset-of-names option just once: it'll request a certificate for the hostnames which do still work, which in your case would be nerd.cx. Assuming that one did authenticate. But in this specific case, if it didn't, no hostnames would be left, so you'd find out soon enough.

Also, you might want to consider adding the www subdomain as that's commonly used. But if you don't want and/or need that, that's fine :slight_smile:

2 Likes

The "--allow-subset-of-names" flag did the trick! Thank you!

The messages actually explained better why it didn't work - I removed the DNS entry for the unused subdomain some time ago, and so the renew was falling over because the DNS system said that that subdomain didn't exist.

It might be useful to identify this as the specific mechanism of failure in the regular "certbot renew" messaging - if I had realized, I could have re-enabled the subdomain in the DNS record, and then removed it via certbot first.

The underlying problem is that I deprecated my project in an order that caused a problem for certbot. Oops!

1 Like

Certbot should have provided you the error message from the ACME server.

Also, it shouldn't be necessary to have the subdomain re-enabled in order to remove it. In fact, it might just provide you with an unnecessary extra certificate.

Certbot is just lousy in how to add/remove hostnames :man_shrugging:t2:

1 Like