Certificate update fails with TypeError

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. https://crt.sh/?q=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: nippohelex.co.jp

I ran this command: certbot certonly --manual

It produced this output: Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
An unexpected error occurred:
TypeError: ‘<’ not supported between instances of ‘NoneType’ and ‘NoneType’

My web server is (include version): Apache/2.4.29

The operating system my web server runs on is (include version): Ubuntu 18.04.4

My hosting provider, if applicable, is: KDDI

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 0.31.0


I initially had a single domain certificate (for www.nippohelex.co.jp), then obtained a wild card certificate (for *.nippohelex.co.jp). Without taking proper procedures, I deleted the files that appeared to be related to the former. Now I need to update the wild card certificate but get the following error:
TypeError: ‘<’ not supported between instances of ‘NoneType’ and ‘NoneType’

I wonder if the deleted domain is still lurking somewhere. Help me please!

Can you post the traceback? It should be near the bottom of /var/log/letsencrypt/letsencrypt.log.

Can you also post the output of “sudo certbot certificates” and “sudo ls -alR /etc/letsencrypt/{archive,live,renewal}”?

For future reference, you can use “sudo certbot delete --cert-name example.org” to delete a certificate, but that doesn’t help right now.

As there are other domains, it’s very long. Sorry about that.

Traceback (most recent call last):
File “/usr/bin/certbot”, line 11, in
load_entry_point(‘certbot==0.31.0’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 1365, in main
return config.func(config, plugins)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 1243, in certonly
should_get_cert, lineage = _find_cert(config, domains, certname)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 286, in _find_cert
action, lineage = _find_lineage_for_domains_and_certname(config, domains, certname)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 313, in _find_lineage_for_domains_and_certname
return _find_lineage_for_domains(config, domains)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 264, in _find_lineage_for_domains
return _handle_identical_cert_request(config, ident_names_cert)
File “/usr/lib/python3/dist-packages/certbot/main.py”, line 194, in _handle_identical_cert_request
if not lineage.ensure_deployed():
File “/usr/lib/python3/dist-packages/certbot/storage.py”, line 797, in ensure_deployed
if self.has_pending_deployment():
File “/usr/lib/python3/dist-packages/certbot/storage.py”, line 816, in has_pending_deployment
smallest_current = min(self.current_version(x) for x in ALL_FOUR)
TypeError: ‘<’ not supported between instances of ‘NoneType’ and ‘NoneType’
2020-04-06 19:33:34,358:ERROR:certbot.log:An unexpected error occurred:


Found the following certs:
Certificate Name: chiisanainochi.org
Domains: chiisanainochi.org www.chiisanainochi.org
Expiry Date: 2019-10-15 04:18:31+00:00 (INVALID: EXPIRED)
Certificate Path: /etc/letsencrypt/live/chiisanainochi.org/fullchain.pem
Private Key Path: /etc/letsencrypt/live/chiisanainochi.org/privkey.pem
Certificate Name: hondana-sanpo.com
Domains: hondana-sanpo.com *.hondana-sanpo.com
Expiry Date: 2020-06-03 06:50:07+00:00 (VALID: 57 days)
Certificate Path: /etc/letsencrypt/live/hondana-sanpo.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/hondana-sanpo.com/privkey.pem
Certificate Name: nippohelex.co.jp
Domains: nippohelex.co.jp *.nippohelex.co.jp
Expiry Date: 2020-04-19 01:17:34+00:00 (VALID: 12 days)
Certificate Path: /etc/letsencrypt/live/nippohelex.co.jp/fullchain.pem
Private Key Path: /etc/letsencrypt/live/nippohelex.co.jp/privkey.pem
Certificate Name: recruit.san-g.com
Domains: recruit.san-g.com
Expiry Date: 2020-06-11 05:09:33+00:00 (VALID: 65 days)
Certificate Path: /etc/letsencrypt/live/recruit.san-g.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/recruit.san-g.com/privkey.pem
Certificate Name: sukusuku-kodomo-clinic.com
Domains: sukusuku-kodomo-clinic.com *.sukusuku-kodomo-clinic.com
Expiry Date: 2020-06-07 07:53:01+00:00 (VALID: 61 days)
Certificate Path: /etc/letsencrypt/live/sukusuku-kodomo-clinic.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/sukusuku-kodomo-clinic.com/privkey.pem

total 32
drwx------ 8 root root 4096 Mar 9 17:53 .
drwxr-xr-x 9 root root 4096 Apr 6 21:07 …
drwxr-xr-x 2 root root 4096 Jul 17 2019 chiisanainochi.org
drwxr-xr-x 2 root root 4096 Mar 5 16:50 hondana-sanpo.com
drwxr-xr-x 2 root root 4096 Jan 20 11:40 nippohelex.co.jp
drwxr-xr-x 2 root root 4096 Jan 16 14:17 ratiojapan.com
drwxr-xr-x 2 root root 4096 Mar 13 15:09 recruit.san-g.com
drwxr-xr-x 2 root root 4096 Mar 9 17:53 sukusuku-kodomo-clinic.com

/etc/letsencrypt/archive/chiisanainochi.org:
total 40
drwxr-xr-x 2 root root 4096 Jul 17 2019 .
drwx------ 8 root root 4096 Mar 9 17:53 …
-rw-r–r-- 1 root root 1919 Jul 17 2019 cert1.pem
-rw-r–r-- 1 root root 1948 Jul 17 2019 cert2.pem
-rw-r–r-- 1 root root 1647 Jul 17 2019 chain1.pem
-rw-r–r-- 1 root root 1647 Jul 17 2019 chain2.pem
-rw-r–r-- 1 root root 3566 Jul 17 2019 fullchain1.pem
-rw-r–r-- 1 root root 3595 Jul 17 2019 fullchain2.pem
-rw------- 1 root root 1708 Jul 17 2019 privkey1.pem
-rw------- 1 root root 1704 Jul 17 2019 privkey2.pem

/etc/letsencrypt/archive/hondana-sanpo.com:
total 24
drwxr-xr-x 2 root root 4096 Mar 5 16:50 .
drwx------ 8 root root 4096 Mar 9 17:53 …
-rw-r–r-- 1 root root 1944 Mar 5 16:50 cert1.pem
-rw-r–r-- 1 root root 1647 Mar 5 16:50 chain1.pem
-rw-r–r-- 1 root root 3591 Mar 5 16:50 fullchain1.pem
-rw------- 1 root root 1704 Mar 5 16:50 privkey1.pem

/etc/letsencrypt/archive/nippohelex.co.jp:
total 28
drwxr-xr-x 2 root root 4096 Jan 20 11:40 .
drwx------ 8 root root 4096 Mar 9 17:53 …
-rw-r–r-- 1 root root 1939 Jan 20 11:17 cert.pem
-rw-r–r-- 1 root root 1647 Jan 20 11:17 chain.pem
-rw-r–r-- 1 root root 3586 Jan 20 11:17 fullchain.pem
-rw------- 1 root root 1704 Jan 20 11:17 privkey.pem
-rw------- 1 root root 1675 Jan 20 11:37 server_rsa.key

/etc/letsencrypt/archive/ratiojapan.com:
total 24
drwxr-xr-x 2 root root 4096 Jan 16 14:17 .
drwx------ 8 root root 4096 Mar 9 17:53 …
-rw-r–r-- 1 root root 1931 Jan 16 14:17 cert1.pem
-rw-r–r-- 1 root root 1647 Jan 16 14:17 chain1.pem
-rw-r–r-- 1 root root 3578 Jan 16 14:17 fullchain1.pem
-rw-r–r-- 1 root root 1704 Jan 16 14:17 privkey1.pem

/etc/letsencrypt/archive/recruit.san-g.com:
total 56
drwxr-xr-x 2 root root 4096 Mar 13 15:09 .
drwx------ 8 root root 4096 Mar 9 17:53 …
-rw-r–r-- 1 root root 1915 Oct 7 13:49 cert1.pem
-rw-r–r-- 1 root root 1915 Jan 1 18:07 cert2.pem
-rw-r–r-- 1 root root 1915 Mar 13 15:09 cert3.pem
-rw-r–r-- 1 root root 1647 Oct 7 13:49 chain1.pem
-rw-r–r-- 1 root root 1647 Jan 1 18:07 chain2.pem
-rw-r–r-- 1 root root 1647 Mar 13 15:09 chain3.pem
-rw-r–r-- 1 root root 3562 Oct 7 13:49 fullchain1.pem
-rw-r–r-- 1 root root 3562 Jan 1 18:07 fullchain2.pem
-rw-r–r-- 1 root root 3562 Mar 13 15:09 fullchain3.pem
-rw------- 1 root root 1708 Oct 7 13:49 privkey1.pem
-rw------- 1 root root 1704 Jan 1 18:07 privkey2.pem
-rw------- 1 root root 1708 Mar 13 15:09 privkey3.pem

/etc/letsencrypt/archive/sukusuku-kodomo-clinic.com:
total 24
drwxr-xr-x 2 root root 4096 Mar 9 17:53 .
drwx------ 8 root root 4096 Mar 9 17:53 …
-rw-r–r-- 1 root root 1980 Mar 9 17:53 cert1.pem
-rw-r–r-- 1 root root 1647 Mar 9 17:53 chain1.pem
-rw-r–r-- 1 root root 3627 Mar 9 17:53 fullchain1.pem
-rw------- 1 root root 1704 Mar 9 17:53 privkey1.pem

/etc/letsencrypt/live:
total 36
drwx------ 8 root root 4096 Apr 6 17:02 .
drwxr-xr-x 9 root root 4096 Apr 6 21:07 …
drwxr-xr-x 2 root root 4096 Jul 17 2019 chiisanainochi.org
drwxr-xr-x 2 root root 4096 Mar 5 16:50 hondana-sanpo.com
drwxr-xr-x 2 root root 4096 Jan 20 11:57 nippohelex.co.jp
drwxr-xr-x 2 root root 4096 Jan 16 17:22 ratiojapan.com
-rw-r–r-- 1 root root 740 Jan 30 2019 README
drwxr-xr-x 2 root root 4096 Mar 13 15:09 recruit.san-g.com
drwxr-xr-x 2 root root 4096 Mar 9 17:53 sukusuku-kodomo-clinic.com

/etc/letsencrypt/live/chiisanainochi.org:
total 12
drwxr-xr-x 2 root root 4096 Jul 17 2019 .
drwx------ 8 root root 4096 Apr 6 17:02 …
lrwxrwxrwx 1 root root 42 Jul 17 2019 cert.pem -> …/…/archive/chiisanainochi.org/cert2.pem
lrwxrwxrwx 1 root root 43 Jul 17 2019 chain.pem -> …/…/archive/chiisanainochi.org/chain2.pem
lrwxrwxrwx 1 root root 47 Jul 17 2019 fullchain.pem -> …/…/archive/chiisanainochi.org/fullchain2.pem
lrwxrwxrwx 1 root root 45 Jul 17 2019 privkey.pem -> …/…/archive/chiisanainochi.org/privkey2.pem
-rw-r–r-- 1 root root 692 Jul 17 2019 README

/etc/letsencrypt/live/hondana-sanpo.com:
total 12
drwxr-xr-x 2 root root 4096 Mar 5 16:50 .
drwx------ 8 root root 4096 Apr 6 17:02 …
lrwxrwxrwx 1 root root 41 Mar 5 16:50 cert.pem -> …/…/archive/hondana-sanpo.com/cert1.pem
lrwxrwxrwx 1 root root 42 Mar 5 16:50 chain.pem -> …/…/archive/hondana-sanpo.com/chain1.pem
lrwxrwxrwx 1 root root 46 Mar 5 16:50 fullchain.pem -> …/…/archive/hondana-sanpo.com/fullchain1.pem
lrwxrwxrwx 1 root root 44 Mar 5 16:50 privkey.pem -> …/…/archive/hondana-sanpo.com/privkey1.pem
-rw-r–r-- 1 root root 692 Mar 5 16:50 README

/etc/letsencrypt/live/nippohelex.co.jp:
total 12
drwxr-xr-x 2 root root 4096 Jan 20 11:57 .
drwx------ 8 root root 4096 Apr 6 17:02 …
lrwxrwxrwx 1 root root 39 Jan 20 11:43 cert.pem -> …/…/archive/nippohelex.co.jp/cert.pem
lrwxrwxrwx 1 root root 40 Jan 20 11:42 chain.pem -> …/…/archive/nippohelex.co.jp/chain.pem
lrwxrwxrwx 1 root root 44 Jan 20 11:42 fullchain.pem -> …/…/archive/nippohelex.co.jp/fullchain.pem
lrwxrwxrwx 1 root root 42 Jan 20 11:42 privkey.pem -> …/…/archive/nippohelex.co.jp/privkey.pem
-rw-r–r-- 1 root root 692 Nov 9 18:46 README

/etc/letsencrypt/live/ratiojapan.com:
total 8
drwxr-xr-x 2 root root 4096 Jan 16 17:22 .
drwx------ 8 root root 4096 Apr 6 17:02 …
lrwxrwxrwx 1 root root 38 Jan 16 17:20 cert1.pem -> …/…/archive/ratiojapan.com/cert1.pem
lrwxrwxrwx 1 root root 39 Jan 16 17:20 chain1.pem -> …/…/archive/ratiojapan.com/chain1.pem
lrwxrwxrwx 1 root root 43 Jan 16 17:21 fullchain.pem -> …/…/archive/ratiojapan.com/fullchain1.pem
lrwxrwxrwx 1 root root 41 Jan 16 17:21 privkey.pem -> …/…/archive/ratiojapan.com/privkey1.pem

/etc/letsencrypt/live/recruit.san-g.com:
total 12
drwxr-xr-x 2 root root 4096 Mar 13 15:09 .
drwx------ 8 root root 4096 Apr 6 17:02 …
lrwxrwxrwx 1 root root 41 Mar 13 15:09 cert.pem -> …/…/archive/recruit.san-g.com/cert3.pem
lrwxrwxrwx 1 root root 42 Mar 13 15:09 chain.pem -> …/…/archive/recruit.san-g.com/chain3.pem
lrwxrwxrwx 1 root root 46 Mar 13 15:09 fullchain.pem -> …/…/archive/recruit.san-g.com/fullchain3.pem
lrwxrwxrwx 1 root root 44 Mar 13 15:09 privkey.pem -> …/…/archive/recruit.san-g.com/privkey3.pem
-rw-r–r-- 1 root root 692 Oct 7 13:49 README

/etc/letsencrypt/live/sukusuku-kodomo-clinic.com:
total 12
drwxr-xr-x 2 root root 4096 Mar 9 17:53 .
drwx------ 8 root root 4096 Apr 6 17:02 …
lrwxrwxrwx 1 root root 50 Mar 9 17:53 cert.pem -> …/…/archive/sukusuku-kodomo-clinic.com/cert1.pem
lrwxrwxrwx 1 root root 51 Mar 9 17:53 chain.pem -> …/…/archive/sukusuku-kodomo-clinic.com/chain1.pem
lrwxrwxrwx 1 root root 55 Mar 9 17:53 fullchain.pem -> …/…/archive/sukusuku-kodomo-clinic.com/fullchain1.pem
lrwxrwxrwx 1 root root 53 Mar 9 17:53 privkey.pem -> …/…/archive/sukusuku-kodomo-clinic.com/privkey1.pem
-rw-r–r-- 1 root root 692 Mar 9 17:53 README

/etc/letsencrypt/renewal:
total 28
drwxr-xr-x 2 root root 4096 Apr 6 19:01 .
drwxr-xr-x 9 root root 4096 Apr 6 21:07 …
-rw-r–r-- 1 root root 588 Jul 17 2019 chiisanainochi.org.conf
-rw-r–r-- 1 root root 547 Mar 5 16:50 hondana-sanpo.com.conf
-rw-r–r-- 1 root root 577 Jan 20 11:17 nippohelex.co.jp.conf
-rw-r–r-- 1 root root 583 Mar 13 15:09 recruit.san-g.com.conf
-rw-r–r-- 1 root root 627 Mar 9 17:53 sukusuku-kodomo-clinic.com.conf

Thank you very much for your advice anyway. I should have known better.

That's not correct. As you can see with the other certificates, the files in /etc/letsencrypt/archive/ are supposed to have numbers in their names, like cert1.pem. But these files have been renamed.

Certbot is failing because it's trying to parse the numbers in the filenames, but there aren't any.

You need to rename those 4 files, and adjust the targets of the 4 symlinks.

(Note that the forum software changed .. to in your post.)

Now it's solved! It was just stupid of me. Thank you so much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.