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

I ran this command: certbot-auto

It produced this output:
Error: couldn’t get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt:
An unexpected error occurred:
VersionConflict: (certbot 0.11.1 (/root/.local/share/letsencrypt/lib/python2.7/site-packages), Requirement.parse(‘certbot==0.10.2’))
Please see the logfile ‘certbot.log’ for more details.

My operating system is (include version): Ubuntu 15.04

My web server is (include version): nginx/1.6.2 (Ubuntu)

My hosting provider, if applicable, is: Rackspace

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

I am getting similar error just runned a cerbot --expand

A certbot update taken place as soon as i run the expand command following upgrade message shows up(given below) in console after this error started coming:

Upgrading certbot-auto 0.10.2 to 0.11.1…
Replacing certbot-auto…
Creating virtual environment…
Installing Python packages…
Installation succeeded.
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

Error Message :
Error: couldn’t get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt

My operating system is: Linux AMI

My web server is : nginx

My hosting provider is: AWS

Does /root/.local/share/letsencrypt/bin/letsencrypt exist ?

if so, can you run

/root/.local/share/letsencrypt/bin/letsencrypt --version

please and paste the result.

I have runned the command you have stated the console output is below:

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

Many thanks, I understand where the issue / bug is now.

do you need to “quick fix” now to obtain new certificates or is it OK to wait a few days for a proper bug fix ?

I would be very glad if you can give a quick fix as i need to obtain new certificates.

can you please answer one small question also is this bug occurred due to update of certbot?

Thanks for your support and guidance.

EDIT:

@schoen @serverco Sorry i am editing this post to send you a reply but there is a policy that do not allow me to post more than 3 reply as i am a new user…

Back to your suggestion i have tried renaming and running certbot it is giving the same error. I am know also thinking this is a update issue and can affect all the user.

Thanks for Support.

I’m not a certbot developer - someone like @schoen can hopefully give a better response, but in my understanding it’s related to the update of certbot, yes.

Looking at the certbot code related to this error, then it’s checking the version of the the code at “$VENV_BIN/letsencrypt” - in your case /root/.local/share/letsencrypt/bin/letsencrypt. Since that check fails (you can see that failure in the command I asked you to run ), then the whole thing fails with the “couldn’t get currently installed version …” error.

I haven’t tested it, but I’d be tempted to try just renaming “/root/.local/share/letsencrypt/bin/letsencrypt” to something else such as “/root/.local/share/letsencrypt/bin/letsencrypt_old” and then re-running certbot (you can always rename it back if that doesn’t help).

@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