Getting “Error: couldn't get currently installed version for letsencrypt” when trying to renew my certificates

@toadalskii I’ve updated your account so you should be able to post.

Interesting - so you got exactly the same error “couldn’t get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt” even though “/root/.local/share/letsencrypt/bin/letsencrypt” doesn’t exist ? or did it recreate that file ?

Yes i get the same error :

Error: couldn’t get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt:
Traceback (most recent call last):
File “/root/.local/share/letsencrypt/bin/letsencrypt”, line 7, in
from certbot.main import main
File “/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/certbot/main.py”, line 11, in
import zope.component
File “/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/zope/component/init.py”, line 16, in
from zope.interface import Interface
ImportError: No module named interface

and the file: /root/.local/share/letsencrypt/bin/letsencrypt recreated

Hi, i got the same error with the same commande

/root/.local/share/letsencrypt/bin/letsencrypt --version
Traceback (most recent call last):
File “/root/.local/share/letsencrypt/bin/letsencrypt”, line 7, in
from certbot.main import main
File “/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/certbot/main.py”, line 11, in
import zope.component
File “/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/zope/component/init.py”, line 16, in
from zope.interface import Interface
ImportError: No module named interface

Hello all,

Just to let you know that I got the same issue and was wondering if there is any option to just rollback to the previous version locally and block the update until you fix the bug ?

Thanks

Hi,

Registered a new account to chime in on this. I’ve got exactly the same problem - Linux Amazon AMI hosted in AWS and I’m getting the same error trying to create a new cert.

I’ve annoyingly got a new client waiting on the cert to go live and I can’t wait a few days for the official fix, is there a dirty work around I can use in the mean time?

Thanks.

1 Like

I found a way to get this work :slight_smile:

 pip install pip --upgrade
 pip install virtualenv --upgrade
virtualenv -p /usr/bin/python27 venv27
. venv27/bin/activate
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
unset PYTHON_INSTALL_LAYOUT

Then update letsencrypt:
./letsencrypt-auto -v

And run the command to renew your certificate.

Created a new account here to chime in with the exact same issue as the others, encountered when running renewals.

Amazon Linux, Apache

Getting a little worried/desperate for a fix, certs are going to expire… is there a rollback option? re-install certbot from scratch?

Wanted to update here in case it helps others, I was able to find a solution.

I simply deleted the actual source dir, but LEFT everything else intact (i.e. /etc/letsencrypt, logs, etc) - this let me re-run certbot-auto installation WITHOUT losing my existing keys, certs, and renewal configuration

do this:

rm -rf ~/.local/share/letsencrypt
./certbot-auto

Once the packages were reinstalled, I could run ‘certbot-auto renew’ again, against my existing configuration. All my existing certs were renewed as normal.

Hopefully this helps someone!

2 Likes

Hi @serverco ,

Any News?

I haven’t heard the latest - hopefully @schoen or @bmw can update in the US morning.

Hi,
run the commands in the following sequence:

rm -rf ~/.local/share/letsencrypt
./certbot-auto --debug
choose c when asked
./letsencrypt-auto --debug certonly -a webroot --agree-tos --renew-by-default YOUR Domain Details.

@Mrvn when I do that, the rm works fine, but when I run certbot-auto --debug I get this:

[root@ip-10-235-0-253 certbot]# ./certbot-auto --debug
Bootstrapping dependencies via Amazon Linux...
yum is /usr/bin/yum
Loaded plugins: priorities, update-motd, upgrade-helper
Package gcc-4.8.3-3.20.amzn1.noarch already installed and latest version
Package augeas-libs-1.0.0-5.7.amzn1.x86_64 already installed and latest version
Package 1:openssl-1.0.1k-15.96.amzn1.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.1k-15.96.amzn1.x86_64 already installed and latest version
Package libffi-devel-3.0.13-16.5.amzn1.x86_64 already installed and latest version
Package system-rpm-config-9.0.3-42.28.amzn1.noarch already installed and latest version
Package ca-certificates-2015.2.6-65.0.1.16.amzn1.noarch already installed and latest version
Package python27-2.7.12-2.120.amzn1.x86_64 already installed and latest version
Package python27-devel-2.7.12-2.120.amzn1.x86_64 already installed and latest version
Package python27-virtualenv-12.0.7-1.13.amzn1.noarch already installed and latest version
Package python27-tools-2.7.12-2.120.amzn1.x86_64 already installed and latest version
Package python27-pip-6.1.1-1.23.amzn1.noarch already installed and latest version
Package 1:mod_ssl-2.2.31-1.8.amzn1.x86_64 already installed and latest version
Nothing to do
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Traceback (most recent call last):
File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
File "/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/certbot/main.py", line 11, in <module>
    import zope.component
File "/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/zope/component/__init__.py", line 16, in <module>
    from zope.interface import Interface
ImportError: No module named interface
[root@ip-10-235-0-253 certbot]#

Note the Traceback at the end. I was never asked any option in order to choose “c”.

OK. I got this working. I went back to @dany-sh’s comment and then everything worked after I ran his commands to update pip, etc.

Ryan

Here’s what’s going on with the message:

Error: couldn't get currently installed version for ~/.local/share/letsencrypt/bin/letsencrypt:

Previously, if your current Certbot installation was broken, we’d just delete it and try and reinstall it. This was causing trouble for people who were trying to customize their local installation, so we now print a message about there being a problem with your current installation and rather than immediately deleting it. This may be the wrong behavior, but you can work around the that problem by deleting the installation yourself by running:

rm -rf "${XDG_DATA_HOME:-~/.local/share}/letsencrypt"

As for

ImportError: No module named interface

this is unfortunately a long standing, known problem with certbot-auto on Amazon Linux. certbot-auto has never fully supported Amazon Linux, as showcased by the need to include --debug when you install Certbot on that system and the following message when you fail to do so:

WARNING: Amazon Linux support is very experimental at present…
if you would like to work on improving it, please ensure you have backups
and then run this script again with the --debug flag!

You can track the progress of this problem at https://github.com/certbot/certbot/issues/2823. We’ve seen some success with unset PYTHON_INSTALL_LAYOUT as recommended above, but that did not solve the issue for everyone in the thread.

Most of our “experimental” support for different distros have been developed by the open source community and then reviewed by the Certbot team. If someone is interested in tracking down the problem here and developing a reliable solution, we’d love to see a pull request, but I don’t think the small number of paid Certbot developers have the resources to investigate and develop a solution for this platform that is currently not officially supported by certbot-auto.

Despite this, I encourage you to try the advice given in this post of deleting your current Certbot installation, running unset PYTHON_INSTALL_LAYOUT, and running certbot-auto --debug again. I hope this helps!

3 Likes

I am still facing this problem. I tried all commands suggested above.

JohnDoe ~/Documents $ sudo rm -rf ~/.local/share/letsencrypt
JohnDoe ~/Documents $ ./certbot-auto --debug
Bootstrapping dependencies for Debian-based OSes...
Atteint http://packages.dotdeb.org wheezy Release.gpg
Atteint http://packages.dotdeb.org wheezy-php56 Release.gpg
Atteint http://packages.dotdeb.org wheezy-php55 Release.gpg
Atteint http://packages.dotdeb.org wheezy Release
Atteint http://packages.dotdeb.org wheezy-php56 Release
Atteint http://packages.dotdeb.org wheezy-php55 Release
Atteint http://packages.dotdeb.org wheezy/all Sources
Atteint http://packages.dotdeb.org wheezy/all amd64 Packages
Atteint http://dl.google.com stable Release.gpg
Atteint http://packages.dotdeb.org wheezy-php56/all Sources
Atteint http://packages.dotdeb.org wheezy-php56/all amd64 Packages
Atteint http://ppa.launchpad.net trusty Release.gpg
Atteint http://ppa.launchpad.net precise Release.gpg
Atteint http://security.debian.org wheezy/updates Release.gpg
Atteint http://ppa.launchpad.net trusty Release
Atteint http://dl.google.com stable Release
Atteint http://security.debian.org wheezy/updates Release
Atteint http://ppa.launchpad.net precise Release
Atteint http://dl.google.com stable/main amd64 Packages
Atteint http://packages.dotdeb.org wheezy-php55/all amd64 Packages
Atteint http://ppa.launchpad.net trusty/main Sources
Atteint http://security.debian.org wheezy/updates/contrib Sources
Atteint http://ppa.launchpad.net trusty/main amd64 Packages
Atteint http://ppa.launchpad.net trusty/main Translation-en
Atteint http://security.debian.org wheezy/updates/non-free Sources
Atteint http://ppa.launchpad.net precise/main Sources
Atteint http://security.debian.org wheezy/updates/contrib amd64 Packages
Atteint http://ppa.launchpad.net precise/main amd64 Packages
Atteint http://ppa.launchpad.net precise/main Translation-en
Ign http://packages.dotdeb.org wheezy/all Translation-fr_FR
Ign http://packages.dotdeb.org wheezy/all Translation-fr
Ign http://packages.dotdeb.org wheezy/all Translation-en
Ign http://packages.dotdeb.org wheezy-php56/all Translation-fr_FR
Ign http://packages.dotdeb.org wheezy-php56/all Translation-fr
Ign http://packages.dotdeb.org wheezy-php56/all Translation-en
Ign http://packages.dotdeb.org wheezy-php55/all Translation-fr_FR
Ign http://packages.dotdeb.org wheezy-php55/all Translation-fr
Ign http://packages.dotdeb.org wheezy-php55/all Translation-en
Atteint http://security.debian.org wheezy/updates/non-free amd64 Packages
Atteint http://security.debian.org wheezy/updates/contrib Translation-en
Atteint http://security.debian.org wheezy/updates/non-free Translation-en
Atteint http://http.debian.net wheezy-backports Release.gpg
Atteint http://http.debian.net wheezy-backports Release
Atteint http://http.debian.net wheezy-backports/main amd64 Packages/DiffIndex
Ign http://dl.google.com stable/main Translation-fr_FR
Ign http://dl.google.com stable/main Translation-fr
Atteint http://http.debian.net wheezy-backports/main Translation-en/DiffIndex
Ign http://dl.google.com stable/main Translation-en
Atteint https://get.docker.io docker Release.gpg
Atteint https://get.docker.io docker Release
Atteint https://get.docker.io docker/main amd64 Packages
Ign https://get.docker.io docker/main Translation-fr_FR
Ign https://get.docker.io docker/main Translation-fr
Ign https://get.docker.io docker/main Translation-en
Lecture des listes de paquets... Fait
W: Aucune clé publique n'est disponible pour la/les clé(s) suivante(s) :
1397BC53640DB551
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
augeas-lenses est déjà la plus récente version disponible.
libaugeas0 est déjà la plus récente version disponible.
openssl est déjà la plus récente version disponible.
python est déjà la plus récente version disponible.
python-dev est déjà la plus récente version disponible.
libffi-dev est déjà la plus récente version disponible.
libssl-dev est déjà la plus récente version disponible.
gcc est déjà la plus récente version disponible.
python-virtualenv est déjà la plus récente version disponible.
ca-certificates est déjà la plus récente version disponible.
0 mis à jour, 0 nouvellement installés, 0 à enlever et 5 non mis à jour.
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Requesting root privileges to run certbot...
  /home/JohnDoe/.local/share/letsencrypt/bin/letsencrypt --debug
Traceback (most recent call last):
  File "/home/JohnDoe/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
from certbot.main import main
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 13, in <module>
from acme import jose
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/__init__.py", line 37, in <module>
from acme.jose.interfaces import JSONDeSerializable
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/interfaces.py", line 9, in <module>
from acme.jose import util
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/util.py", line 5, in <module>
import OpenSSL
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 12, in <module>
from OpenSSL._util import (
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /home/JohnDoe/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: OPENSSL_sk_num

Thanks.

Are you seeing the error “Error: couldn’t get currently installed version” ? from your logs this looks like a completely different issue to the one in this thread.

If you are not seeing that specific error, I’d suggest splitting this into a more appropriate new topic.

yes it’s exactly the error I meet: “Error: couldn’t get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt:”

root /etc/apache2/sites-available # cd /home/JohnDoe/Documents/ && ./certbot-auto --logs-dir /var/log/letsencrypt/
Error: couldn't get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
	from certbot.main import main
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 13, in <module>
	from acme import jose
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/__init__.py", line 37, in <module>
	from acme.jose.interfaces import JSONDeSerializable
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/interfaces.py", line 9, in <module>
	from acme.jose import util
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/util.py", line 5, in <module>
	import OpenSSL
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
	from OpenSSL import rand, crypto, SSL
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 12, in <module>
	from OpenSSL._util import (
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
	from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
	from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /root/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: OPENSSL_sk_num

OK, Thanks, I didn’t see it in the earlier log.

and you have deleted the letsencrypt folder from any earlier installations, yet still getting the error ? can you manually try removing /root/.local/share/letsencrypt and trying again ?

Same error :confused:

root ~ # rm -rf /root/.local/share/letsencrypt
root ~ # cd /home/JohnDoe/Documents
root /home/JohnDoe/Documents # ./certbot-auto
Bootstrapping dependencies for Debian-based OSes...
Atteint http://packages.dotdeb.org wheezy Release.gpg
Atteint http://packages.dotdeb.org wheezy-php56 Release.gpg
Atteint http://packages.dotdeb.org wheezy-php55 Release.gpg
Atteint http://packages.dotdeb.org wheezy Release
Atteint http://packages.dotdeb.org wheezy-php56 Release
Atteint http://security.debian.org wheezy/updates Release.gpg
Atteint http://dl.google.com stable Release.gpg
Atteint http://ppa.launchpad.net trusty Release.gpg
Atteint http://ppa.launchpad.net precise Release.gpg
Atteint http://packages.dotdeb.org wheezy-php55 Release
Réception de : 1 http://http.debian.net wheezy-backports Release.gpg [1 554 B]
Atteint http://ppa.launchpad.net trusty Release
Atteint http://dl.google.com stable Release
Atteint http://security.debian.org wheezy/updates Release
Atteint http://ppa.launchpad.net precise Release
Réception de : 2 http://http.debian.net wheezy-backports Release [164 kB]
Atteint http://packages.dotdeb.org wheezy/all Sources
Atteint http://packages.dotdeb.org wheezy/all amd64 Packages
Atteint http://packages.dotdeb.org wheezy-php56/all Sources
Atteint http://packages.dotdeb.org wheezy-php56/all amd64 Packages
Atteint http://ppa.launchpad.net trusty/main Sources
Atteint http://dl.google.com stable/main amd64 Packages
Atteint http://security.debian.org wheezy/updates/contrib Sources
Atteint http://ppa.launchpad.net trusty/main amd64 Packages
Atteint http://http.debian.net wheezy-backports/main amd64 Packages/DiffIndex
Atteint http://packages.dotdeb.org wheezy-php55/all amd64 Packages
Atteint http://security.debian.org wheezy/updates/non-free Sources
Atteint http://security.debian.org wheezy/updates/contrib amd64 Packages
Atteint http://ppa.launchpad.net trusty/main Translation-en
Atteint http://ppa.launchpad.net precise/main Sources
Atteint http://ppa.launchpad.net precise/main amd64 Packages
Atteint http://http.debian.net wheezy-backports/main Translation-en/DiffIndex
Atteint http://security.debian.org wheezy/updates/non-free amd64 Packages
Atteint http://ppa.launchpad.net precise/main Translation-en
Atteint http://security.debian.org wheezy/updates/contrib Translation-en
Atteint http://security.debian.org wheezy/updates/non-free Translation-en
Ign http://packages.dotdeb.org wheezy/all Translation-fr_FR
Ign http://packages.dotdeb.org wheezy/all Translation-fr
Ign http://packages.dotdeb.org wheezy/all Translation-en
Ign http://packages.dotdeb.org wheezy-php56/all Translation-fr_FR
Ign http://packages.dotdeb.org wheezy-php56/all Translation-fr
Ign http://packages.dotdeb.org wheezy-php56/all Translation-en
Ign http://packages.dotdeb.org wheezy-php55/all Translation-fr_FR
Ign http://packages.dotdeb.org wheezy-php55/all Translation-fr
Ign http://packages.dotdeb.org wheezy-php55/all Translation-en
Ign http://dl.google.com stable/main Translation-fr_FR
Ign http://dl.google.com stable/main Translation-fr
Ign http://dl.google.com stable/main Translation-en
Atteint https://get.docker.io docker Release.gpg
Atteint https://get.docker.io docker Release
Atteint https://get.docker.io docker/main amd64 Packages
Ign https://get.docker.io docker/main Translation-fr_FR
Ign https://get.docker.io docker/main Translation-fr
Ign https://get.docker.io docker/main Translation-en
166 ko réceptionnés en 23s (7 008 o/s)
Lecture des listes de paquets... Fait
W: Aucune clé publique n'est disponible pour la/les clé(s) suivante(s) :
1397BC53640DB551
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
augeas-lenses est déjà la plus récente version disponible.
libaugeas0 est déjà la plus récente version disponible.
openssl est déjà la plus récente version disponible.
python est déjà la plus récente version disponible.
python-dev est déjà la plus récente version disponible.
libffi-dev est déjà la plus récente version disponible.
libssl-dev est déjà la plus récente version disponible.
gcc est déjà la plus récente version disponible.
python-virtualenv est déjà la plus récente version disponible.
ca-certificates est déjà la plus récente version disponible.
0 mis à jour, 0 nouvellement installés, 0 à enlever et 5 non mis à jour.
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 13, in <module>
    from acme import jose
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/__init__.py", line 37, in <module>
    from acme.jose.interfaces import JSONDeSerializable
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/interfaces.py", line 9, in <module>
    from acme.jose import util
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/util.py", line 5, in <module>
    import OpenSSL
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /root/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: OPENSSL_sk_num

root ~ # lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.11 (wheezy)
Release: 7.11
Codename: wheezy
root ~ # uname -a
Linux JohnDoe 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.39-1~bpo70+1 (2017-01-12) x86_64 GNU/Linux

root ~ # openssl version
OpenSSL 1.1.0e 16 Feb 2017

Edit: added some missing information about config
Hope this helps

As far as I can see, from this post, and the first post - it does not mention the “couldn’t get installed version” error. Your second post does though,

What’s the difference between these two runs ?

How did you install certbot ? ( /home/JohnDoe/Documents/ seems an unusual location )