pkg_resources.VersionConflict: (certbot 0.40.0 (/usr/lib/python3/dist-packages), Requirement.parse('certbot>=2.6.0'))

Suddenly my certbot is not working.

Upon issue simple command : certbot renew

the captioned error happened, the certbot unable to run. It's been working fine.

pkg_resources.VersionConflict: (certbot 0.40.0 (/usr/lib/python3/dist-packages), Requirement.parse('certbot>=2.6.0'))
Please see the logfile '/tmp/tmpqpczvsz3/log' for more details.

cat /tmp/tmpqpczvsz3/log
2023-06-12 15:00:56,584:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in
load_entry_point('certbot==0.40.0', 'console_scripts', 'certbot')()
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1348, in main
plugins = plugins_disco.PluginsRegistry.find_all()
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 208, in find_all
plugin_ep = PluginEntryPoint(entry_point)
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 50, in init
self.plugin_cls = entry_point.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2444, in load
self.require(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2467, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (certbot 0.40.0 (/usr/lib/python3/dist-packages), Requirement.parse('certbot>=2.6.0'))
2023-06-12 15:00:56,584:ERROR:certbot.log:An unexpected error occurred:

my system is
ubuntu 20 LTS
certbot 0.40.0 ( apt install certbot claimed this is the later version )

i don't understand while certbot 0.40.0 is latest by apt install, how comes there a 2.6.0?

It seems like you might have a Certbot plugin installed which is causing this.

What is the output of:

pip freeze | grep -i certbot
3 Likes

pip freeze | grep -i certbot
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in
from pip._internal.cli.main import main
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in
from pip._internal.cli import cmdoptions
File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 24, in
from pip._internal.exceptions import CommandError
File "/usr/lib/python3/dist-packages/pip/_internal/exceptions.py", line 10, in
from pip._vendor.six import iteritems
File "/usr/lib/python3/dist-packages/pip/_vendor/init.py", line 65, in
vendored("cachecontrol")
File "/usr/lib/python3/dist-packages/pip/_vendor/init.py", line 36, in vendored
import(modulename, globals(), locals(), level=0)
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/init.py", line 9, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/adapter.py", line 5, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/init.py", line 95, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in
File "/usr/lib/python3/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

i did
pip install certbot-dns-linode

previously.

That's not good. I think your system's Python packages are hosed. Do you have /usr/bin/pip? /usr/bin/pip3 maybe?

It looks like your system has a mix of Python packages from apt and from elsewhere. Unfortunately, this is a recipe for disaster, because packages like this don't mix well.

This is why we recommend installing Certbot using either the snap instructions or the pip instructions. It's hard for those to run into issues like this one.

For what it's worth, Ubuntu 20.04 has its own certbot-dns-linode package and using pip is unnecessary: Ubuntu – Details of package python3-certbot-dns-linode in focal. But that probably won't help you undo the damage from pip.

5 Likes

thanks for your sharing of idea, it's very helpful. have a search now i have eliminated the error of

CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK\r

now at least previous working scripts are working again.

i did

apt-get --reinstall install python-apt
apt-get --reinstall install apt-transport-https
apt-get install build-essential libssl-dev libffi-dev python-dev

now i am working on your suggestion using snap to reinstall the certbot.

1 Like

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