TypeError: encoding must be an item from the Encoding enum

Please fill out the fields below so we can help you better.

My domain is: xahana.org

I ran this command: certbot

It produced this output:
An unexpected error occurred:
TypeError: encoding must be an item from the Encoding enum
Please see the logfiles in /var/log/letsencrypt for more details.

You can check the full output of the log here : https://pastebin.com/SHZVJFgF
My web server is (include version):Apache/2.4.10 (Debian)

The operating system my web server runs on is (include version): Debian 8

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


Hi there,

I am using certbot for several months now, it’s setted up in a crontab, etc.
This morning, I received an email saying that one of my cert was expiring today, which I found pretty strange… So I logued in and launched a certbot renew… And got the same error as the one I pasted in the description field.

As I didn’t know what was wrong, I deleted the /etc/letsencrypt directory, to “start fresh”, and since I am stuck with that error, I can’t do anything… Any advice to solve this issue ?

@bmw, would you be willing to look at this? It looks like it is a form of the same problem as

which it appears we may not have made progress on diagnosing.

Hi @sbourgeois
Have you tried re-installing certbot? It’s likely that you updated your version of OpenSSL somehow and that broke certbot. Can you apt-get update / upgrade and see if you get a newer version of certbot and see if that fixes it?
Also @schoen you can feel free to tag me in on these sorts of issues in the future

@schoen : indeed, it seems to be the same issue !

@SwartzCr : I did try to uninstall/purge the package, and did a apt update/upgrade before reinstalling the package, same issue.

can you let me know:
What version of debian you have
What version of certbot you have
what version of openssl you have (run the command dpkg -l openssl)

Here are the info requested :
OS

Distributor ID: Debian
Description:    Debian GNU/Linux 8.8 (jessie)
Release:        8
Codename:       jessie

SSL

ii  openssl                     1.0.1t-1+deb8u6    amd64              Secure Sockets Layer toolkit - cryptographic utility

Certbot

ii  certbot                     0.10.2-1~bpo8+1    all                automatically configure HTTPS using Let's Encrypt

Interesting
I think your version of Python-Cryptography might be out of sync with what certbot wants.
Have you globally pip installed cryptography?
Can you run python -c 'import cryptography; print cryptography.__version__' and tell me the output?

# python -c 'import cryptography; print cryptography.__version__'
1.3.4

EDIT : just did an apt update/upgrade :

The following packages will be upgraded:
  libexpat1 python-cryptography
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Should I try to update or do you want me to stay as it is for the moment, to find out what’s wrong ?

I had the same problem as you so I ended up just using the certbot source code:

Hope this helps!

So I just tested on a fresh debian 8, and it works for me - my cryptography version is 1.7.1 - so maybe try upgrading cryptography. If it doesn’t work immediately, reinstalling certbot might make it work (after upgrading cryptography). Can you give that a try and let me know how it goes?

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