Certbot-auto renew upgraded '1.5.0 to 1.7.0.' unexpectedly and broke certbot: virtualenv 15.1.0 error

My domain is: kindect.com

I ran this command:

sudo ./certbot-auto renew --force-renew --debug

It produced this output:

sudo ./certbot-auto renew --force-renew --dry-run --debug
[root@frozengate ec2-user]# ./certbot-auto renew --force-renew
Upgrading certbot-auto 1.5.0 to 1.7.0…
Replacing certbot-auto…
Creating virtual environment…
Traceback (most recent call last):
File “/usr/bin/virtualenv”, line 6, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3049, in
@_call_aside
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3033, in _call_aside
f(*args, **kwargs)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 660, in _build_master
return cls._build_from_requirements(requires)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 673, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 858, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘virtualenv==15.1.0’ distribution was not found and is required by the application
Traceback (most recent call last):
File “”, line 27, in
File “”, line 19, in create_venv
File “/usr/lib64/python2.7/subprocess.py”, line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘virtualenv’, ‘–no-site-packages’, ‘–python’, ‘/usr/bin/python2.7’, ‘/opt/eff.org/certbot/venv’]’ returned non-zero exit status 1

My web server is (include version):

Apache/2.4.43 (Amazon)

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

[root@frozengate ec2-user]# aws --version
aws-cli/1.18.13 Python/2.7.18 Linux/4.14.186-110.268.amzn1.x86_64 botocore/1.15.13

My hosting provider, if applicable, is:

Amazon

I can login to a root shell on my machine (yes or no, or I don’t know):

Yeah

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
Broken… see below… this was working before… I would suggest not auto upgrading the client without asking the user first.

[root@frozengate ec2-user]# ./certbot-auto --version
FATAL: 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!
Alternatively, you can install OS dependencies yourself and run this script
again with --no-bootstrap.

Please advise if there is a way to fix , or any tips, thank you so much for looking into it. Lets Encrypt is the best. Note: my cert is still working on kindect dot com just the client is broken.

1 Like

Update… I reinstalled python27-virtualenv-15.1.0-1.14.amzn1.noarch via yum… but now I receive this error:

[root@frozengate ec2-user]# ./certbot-auto renew --force-renew --dry-run --debug
Bootstrapping dependencies for Amazon… (you can skip this with --no-bootstrap)
yum is /usr/bin/yum
yum is hashed (/usr/bin/yum)
Loaded plugins: priorities, update-motd, upgrade-helper
1124 packages excluded due to repository priority protections
Package gcc-4.8.5-1.22.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.2k-16.151.amzn1.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.2k-16.151.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-2018.2.22-65.1.22.amzn1.noarch already installed and latest version
Package python27-devel-2.7.18-1.138.amzn1.x86_64 already installed and latest version
Package python27-virtualenv-15.1.0-1.14.amzn1.noarch already installed and latest version
Package python27-tools-2.7.18-1.138.amzn1.x86_64 already installed and latest version
Package python27-pip-9.0.3-1.27.amzn1.noarch already installed and latest version
Nothing to do
Creating virtual environment…
Traceback (most recent call last):
File “/usr/bin/virtualenv”, line 11, in
load_entry_point(‘virtualenv==15.1.0’, ‘console_scripts’, ‘virtualenv’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 564, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2662, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2316, in load
return self.resolve()
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2326, in resolve
raise ImportError(str(exc))
ImportError: ‘module’ object has no attribute ‘main’
Traceback (most recent call last):
File “”, line 27, in
File “”, line 19, in create_venv
File “/usr/lib64/python2.7/subprocess.py”, line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘virtualenv’, ‘–no-site-packages’, ‘–python’, ‘/usr/bin/python2.7’, ‘/opt/eff.org/certbot/venv’]’ returned non-zero exit status 1

This one is much more vague though…

Please let me know if any ideas, I’m also researching it more as well

Thanks a ton!!

1 Like

Here is how I fixed this… although it doesn’t address the underlying original problem really

  1. Install python 3.6 virtual env (which also put python 3.6 on my system as a dependency, I only had python 2.7 before)…

yum install python36-virtualenv.noarch

USE_PYTHON_3=1 ./certbot-auto renew --force-renew --debug

Done… cert renew works now…

1 Like

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