Certbot renew says Not yet due for renewal; email says otherwise

At some point in the past, you either (i) added (or removed) a name from your certificate(s), or (ii) got an entirely new certificate with overlapping domain(s) to an existing certificate. This caused two things to happen:

  1. Certbot added the numbers (0001, 0001, etc) because of a name collision. This is messy and confusing to everyone who tries to deal with it. This is (unfortunately) the way Certbot chose to organize the files on your disk. Every directory could have an active certificate in there. The one with the latest number should be the most recently configured certificate, but - again - all directories could have existing Certificates.

  2. The courtesy "reminder" emails from LetsEncrypt are sent from a system that has no idea if you replaced/updated the Certificate with a newer one. What confuses many people, is this order of events:

    • Get a Certificate for: Domain A, Domain B
    • Renew that Certificate for: Domain A, Domain B, Domain C
    • Get a warning about this certificate expiring: Domain A, Domain B
    • Certbot says no renewals are necessary.

As far as LetsEncrypt (cloud) is concerned, DomainA+DomainB is about to expire.
As far as Certbot (local) is concerned, no renewals are needed because DomainA+DomainB+DomainC replaced that other certificate.

It's possible there are other things happening. I've seen upgrades to Python and operating systems somehow trigger the directory versioning "thing". The same can happen when people try to do a manual backup/cleanup/etc. When that has happened, it's basically the same exact situation I described above.

The easiest thing to do is just audit Certbot and your services, to just make sure they are using a currently managed certificate, and upgrade everything to use the current options. If you want to return to a system without prefixes, I would backup /etc/letsencrypt for safety, but then delete the directory and just start from scratch.

4 Likes