Trouble installing certbot

Server: Raspbian GNU/Linux 10 (Buster)
Certbot: 1.0.0

This is a new install of Buster on a rpi 4. Upon installing nginx, php and cerbot, I perform a test run creating certificates using the webroot method. It looks like it will pass but failed because it could not verify my domain. That is given because my domain isn’t setup on this server.

I proceed to install the cloudflare dns plugin as I will want to create a wildcard using this method.
https://www.eigenmagic.com/2018/03/14/howto-use-certbot-with-lets-encrypt-wildcard-certificates/

There was some error outputs as it was creating the file. When it finished and I try to perform a test run creating a wildcard, I am prompt with this error and any command of `sudo certbot…’ the same error pops up. Not sure what to do at this point.

certbot --version
Traceback (most recent call last):
File "/usr/local/bin/certbot", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (cryptography 2.6.1 (/usr/lib/python2.7/dist-packages), Requirement.parse('cryptography>=2.8'), set(['PyOpenSSL']))

This from the error message says it all: your cryptography library is too old for this version of certbot.

It seems Buster only has 2.6.1 currently (Debian -- Details of package python3-cryptography in buster)

Hmm, the "regular" certbot doesn't seem to require cryptography>=2.8? Are you using certbot-auto by any chance?

1 Like

I installed certbot via this cmd

apt-get install letsencrypt

I believe I have certbot and not certbot-auto.

You have a second installation of some kind -- apt-get install doesn't put things in /usr/local/.

1 Like

I have removed certbot from this location. /usr/local/bin/certbot

I am still getting similar error.

certbot -v
Traceback (most recent call last):
File "/usr/bin/certbot", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (cryptography 2.6.1 (/usr/lib/python2.7/dist-packages), Requirement.parse('cryptography>=2.8'), set(['PyOpenSSL']))

Fixed.
I believe I’ve gotten Certbot sorted out. Somewhere during the installation of certbot-dns-cloudflare plugin using this certbot guide, but the installation had an error saying Cryptography requires a newer version. I, than, tried to install certbot-dns-cloudflare using pip and it installed a different version of Certbot in /usr/local/bin. Cerbot doesn’t run well when multiple versions of Cerbot is installed. So I uninstall the pip version of Cerbot by listing what pip installed and using the pip3 uninstall.

pip3 list | grep certbot
sudo pip3 uninstall <package-name>

Install Cloudflare Plugin

sudo apt-get install python3-certbot-dns-cloudflare

Did a test run for both the webroot and the wildcard method and it seem to run ok.

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