Problem renewal certificates


I'm using Ubuntu 20.04.02 LTS and having issues with certbot. For a few weeks, I cannot renew my certificates.

CLI: certbot certonly --manual --preferred-challenges dns -d * -d

I get the following error log:
aving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
An unexpected error occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/", line 379, in prepare_url
scheme, auth, host, port, path, query, fragment = parse_url(url)
File "/usr/lib/python3/dist-packages/urllib3/util/", line 392, in parse_url
return six.raise_from(LocationParseError(source_url), None)
File "", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse:

During handling of the above exception, another exception occurred:

requests.exceptions.InvalidURL: Failed to parse:
Please see the logfiles in /var/log/letsencrypt for more details.

Any idea what could be wrong? I have reinstalled urllib3 and certbot. Doesn't clear the issue.



From searching around, it looks like it might be a problem with the python3-six package.

Perhaps try:

sudo apt install --reinstall python3-six

Did the reinstall. Didn't fix the issue.
wget is working fine. So the site is reachable.


Well, if I read the code for parse_url() correctly, the exception is raised on any ValueError or AttributeError in the try: block, which contains 24 lines of code.

However, without being able to reproduce the error, it's rather hard to debug it locally I'm afraid.


Fixed the problem. I have install certbot via apt install certbot. This version was causing the problem. The snap install version is ok. I will open a cause with Ubuntu.

Thanks for your support.


I think the snap version of certbot comes with the Python dependencies embedded in the snap, so that would indeed fix this issue, but just for certbot. Other packages/applications might suffer from the same bug.


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