Error while renewing (and extending) certificate

Hi, I have previously issued a certificate for my domain, say it is domain.de. Now I want to extend it with an SAN for www.domain.de. Hence I just run ./letsencrypt-auto certonly --webroot -w /var/www/letsencrypt/ -d domain.de -d www.domain.de. When I run the tool, the client asks me whether I want to extend the given certificate, and I answer with expand. After some seconds, the following message occurs:

Do you want to expand and replace this existing certificate with the new
certificate?
-------------------------------------------------------------------------------
(E)xpand/(C)ancel: E
An unexpected error occurred:
ValueError: max() arg is an empty sequence
Please see the logfiles in /var/log/letsencrypt for more details.

The error log shows the following Python exception:

2016-01-17 14:15:40,137:DEBUG:letsencrypt.cli:Exiting abnormally:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 1398, in main
    return args.func(args, config, plugins)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 600, in obtain_cert
    _auth_from_domains(le_client, config, domains)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 394, in _auth_from_domains
    lineage.latest_common_version(), OpenSSL.crypto.dump_certificate(
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/storage.py", line 372, in latest_common_version
    return max(n for n in versions[0] if all(n in v for v in versions[1:]))
ValueError: max() arg is an empty sequence

If required, I can also post the full log. Thanks for helping!

1 Like

You can rename or remove existing cert under /etc/letsencrypt/live and re-run your command. It works for me.

Besides answering a +2y old question, this is bad advice. Removing a certificate should be done with certbot delete --cert-name ...

1 Like

Good advice and “besides”, thank you for the men coming here.

Good advice and “besides”, thank you for the men coming here.