The 'configobj' distribution was not found and is required by certbot

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:www.kidfrankensteinthemusical.com

I ran this command:
sudo certbot --apache

It produced this output:
Traceback (most recent call last):
File "/usr/local/bin/certbot", line 6, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3251, in
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3264, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 583, in _build_master
ws.require(requires)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'configobj' distribution was not found and is required by certbot

My web server is (include version):
Apache/2.4.41 (Ubuntu)

The operating system my web server runs on is (include version):
Ubuntu 20.04.3 LTS
Linux server 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

My hosting provider, if applicable, is:
OLM.NET
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
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
certbot 0.24.0.dev0

How did you install that version of certbot? Because the .dev0 versions aren't packaged in an official way as far as I know. Please use a regular method of installing certbot, preferably a more recent version and by using the official guide at https://certbot.eff.org/

2 Likes

I followed this guide:https://certbot.eff.org/instructions?ws=nginx&os=ubuntu-20 Let me try your link. Thank you.

1 Like

This looks like the same guide. How do I fully remove all old certbot and python and keep config files so I can start over? Thank you.

1 Like

That ancient version would not have been installed using snap as the official guide says. It seems you have multiple instances of certbot on your system.

What does whois certbot say? And what does ls -l /snap/bin/certbot say?

Also, the question on how to remove the old version really depends on how you installed it in the first place.

2 Likes

lrwxrwxrwx 1 root root 13 Nov 12 16:16 /snap/bin/certbot -> /usr/bin/snap

whois returns Nothing.

1 Like

Try:
which certbot

1 Like

which: /usr/local/bin/certbot
also
sudo certbot --apache
sudo: unable to execute /usr/local/bin/certbot: No such file or directory

1 Like

I fully removed certbot and followed this tutorial.

1 Like

What shows:
sudo apt update
sudo apt-get update

1 Like

sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 https://download.docker.com/linux/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

sudo apt upgrade
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

1 Like

I think I have certbot working but now my apache config file are all mucked up. I think they are looking for letsencrypt files I've deleted.

1 Like

Oh crap, I meant that command of course! Stupid of me..

While that's certainly possible, the certificate files should not have been touched when removing the program certbot itself.

2 Likes

sudo /usr/bin/certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.

apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 8 of /etc/apache2/sites-enabled/flightschoolthemusical.com-le-ssl.conf: Could not open configuration file /etc/letsencrypt/options-ssl-apache.conf: No such file or directory

The apache plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError("Error while running apache2ctl configtest.\nAction 'configtest' failed.\nThe Apache error log may have more information.\n\napache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 8 of /etc/apache2/sites-enabled/flightschoolthemusical.com-le-ssl.conf: Could not open configuration file /etc/letsencrypt/options-ssl-apache.conf: No such file or directory\n")

1 Like

I think certbot is running now but:
Requesting a certificate for xxxx.com
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

netstat -tulpn | grep LISTEN | grep ':80'
tcp6 0 0 :::80 :::* LISTEN 21720/apache2

1 Like

You missed:

Please show the output of:
sudo apachectl -t -D DUMP_VHOSTS
certbot --version
certbot certificates

1 Like

sudo apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:5 https://download.docker.com/linux/ubuntu focal InRelease
Fetched 328 kB in 2s (197 kB/s)
Reading package lists... Done

certbot --version
-bash: /usr/local/bin/certbot: /usr/bin/python: bad interpreter: No such file or directory

sudo apachectl -t -D DUMP_VHOSTS
VirtualHost configuration:

certbot --version
-bash: /usr/local/bin/certbot: /usr/bin/python: bad interpreter: No such file or directory

certbot certificates
-bash: /usr/local/bin/certbot: /usr/bin/python: bad interpreter: No such file or directory

1 Like

We I removed the old certbot code it also remove the /live/ directory with all the acteive certs. So I can't start apache with out error.

if I comment out #IncludeOptional sites-enabled/*.conf
in: /etc/apache2/apache2.conf I can start the server fine.

Maybe I have to manually install the certs now.

1 Like

Well that was unfortunate.

Try disabling the sites instead.

1 Like

ok but there are a bunch of sites in there

1 Like