Error renewing on Ubuntu 20.04 VPS

Ubuntu 20.04 VPS with hostinger.
I have multiple domans all having expired certificates.
The first domain is aecperformance.com

I had certbot installed and multiple domains certified. Everything worked great.
After 3 months my certificates all expired.
I ran: sudo certbot renew and got an error: Command '('lsb_release', '-a')' returned non-zero exit status 1.
I uninstalled certbot and went to your site to learn how to reinstall it.
Your site indicates that I have to use snapd to install it.
My server had snapd already installed.

I tried running: sudo snap install core; sudo snap refresh core
I got this error: system does not fully support snapd: cannot mount squashfs image using "squashfs"

After some research I learned that apparently squashfs files are Ubuntu CORE files and since I'm running a VPS the core files are not accessible. So, while snapd is installed my VPS apparently can't use it.

I did successfully reinstall certbot with this command: sudo apt install certbot
It installed successfully.
I ran: sudo certbot --version and it returned: certbot 0.40.0
I ran: sudo certbot renew and it returned an error: The requested apache plugin does not appear to be installed.
I ran: sudo apt install certbot python3-certbot-apache
Of course certbot was already installed but it successfully installed the plugin.
I ran: sudo certbot --version
It returned an error: Command '('lsb_release', '-a')' returned non-zero exit status 1

I ran: sudo apt-get remove certbot and then sudo apt autoremove to uninstall it.

Per this: Certbot Instructions | Certbot
I ran: sudo snap install --classic certbot
I got this error again: system does not fully support snapd: cannot mount squashfs image using
"squashfs"

I cannot renew my certificates and all my sites are down.
Please let me know how I can reinstall certbot and successfully renew my certificates.

Hi @VdTsCoder and welcome to the LE community forum :slight_smile:

What happens with?:
sudo snap install core; sudo snap refresh core

1 Like

Could you also please provide the letsencrypt.log file at /var/log/letsencrypt/ ? Because lsb_release is not mentioned anywhere in the Certbot code (not currently and not in version 0.40.0), so I'm puzzled what's causing it..

2 Likes

Ubuntu and Ubuntu CORE are different distributions, I think.

I don't know if --classic works on Ubuntu CORE.

1 Like

squashfs is a Linux feature, but occasionally webhosts build Linux kernels without squashfs included. In these cases, you cannot use snaps at all.

Ubuntu's official images include squashfs, as do most other distributions.

We need to see the /var/log/letsencrypt/letsencrypt.log file to understand what is going on.

3 Likes

This happened: [quote="VdTsCoder, post:1, topic:174249"]
I tried running: sudo snap install core; sudo snap refresh core
I got this error: system does not fully support snapd: cannot mount squashfs image using "squashfs"
[/quote]

2022-03-21 15:10:51,378:ERROR:certbot.renewal:All renewal attempts failed. The following certs could not be renewed:
2022-03-21 15:10:51,378:ERROR:certbot.renewal: /etc/letsencrypt/live/aecperformance.com/fullchain.pem (failure)
2022-03-21 15:10:51,378: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 1382, in main
return config.func(config, plugins)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1287, in renew
renewal.handle_renewal_request(config)
File "/usr/lib/python3/dist-packages/certbot/renewal.py", line 486, in handle_renewal_request
raise errors.Error("{0} renew failure(s), {1} parse failure(s)".format(
certbot.errors.Error: 1 renew failure(s), 0 parse failure(s)
2022-03-21 18:41:26,475:DEBUG:certbot.main:certbot version: 0.40.0
2022-03-21 18:41:26,475:DEBUG:certbot.main:Arguments:
2022-03-21 18:41:26,476:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2022-03-21 18:41:26,487:DEBUG:certbot.log:Root logging level set at 20
2022-03-21 18:41:26,487:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2022-03-21 18:41:26,497:DEBUG:certbot.plugins.selection:Requested authenticator <certbot.cli._Default object at 0x7fcfb66ffca0> and installer <certbot.cli._Default object at 0x7fcfb66ffca0>
2022-03-21 18:41:26,505:DEBUG:certbot.storage:Should renew, less than 30 days before certificate expiry 2022-03-20 15:16:54 UTC.
2022-03-21 18:41:26,505:INFO:certbot.renewal:Cert is due for renewal, auto-renewing...
2022-03-21 18:41:26,505:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2022-03-21 18:41:26,505:DEBUG:certbot.plugins.selection:No candidate plugin
2022-03-21 18:41:26,505:DEBUG:certbot.plugins.selection:No candidate plugin
2022-03-21 18:41:26,505:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None
2022-03-21 18:41:26,505:INFO:certbot.main:Could not choose appropriate plugin: The requested apache plugin does not appear to be installed
2022-03-21 18:41:26,505:WARNING:certbot.renewal:Attempting to renew cert (aecperformance.com) from /etc/letsencrypt/renewal/aecperformance.com.conf produced an unexpected error: The requested apache plugin does not appear to be installed. Skipping.
2022-03-21 18:41:26,506:DEBUG:certbot.renewal:Traceback was:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/certbot/renewal.py", line 462, in handle_renewal_request
main.renew_cert(lineage_config, plugins, renewal_candidate)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1202, in renew_cert
installer, auth = plug_sel.choose_configurator_plugins(config, plugins, "certonly")
File "/usr/lib/python3/dist-packages/certbot/plugins/selection.py", line 235, in choose_configurator_plugins
diagnose_configurator_problem("authenticator", req_auth, plugins)
File "/usr/lib/python3/dist-packages/certbot/plugins/selection.py", line 339, in diagnose_configurator_problem
raise errors.PluginSelectionError(msg)
certbot.errors.PluginSelectionError: The requested apache plugin does not appear to be installed

2022-03-21 18:41:26,506:ERROR:certbot.renewal:All renewal attempts failed. The following certs could not be renewed:
2022-03-21 18:41:26,506:ERROR:certbot.renewal: /etc/letsencrypt/live/aecperformance.com/fullchain.pem (failure)
2022-03-21 18:41:26,506: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 1382, in main
return config.func(config, plugins)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1287, in renew
renewal.handle_renewal_request(config)
File "/usr/lib/python3/dist-packages/certbot/renewal.py", line 486, in handle_renewal_request
raise errors.Error("{0} renew failure(s), {1} parse failure(s)".format(
certbot.errors.Error: 1 renew failure(s), 0 parse failure(s)

I believe that snapd threw that error, not certbot. Certbot was apparently depending on snapd???

I think you're right. I hope that doesn't mean that certbot is not available to people running a linux VPS.

The snap version of certbot does indeed depend on snapd.

There are other (less demanding) acme clients, if you need them: ACME Client Implementations - Let's Encrypt

1 Like

9peppe: So you're saying that certbot cannot be used on a linux VPS? That's a shame. 3 months ago I installed and used it with no problem. Now it's completely unavailable to anyone running a VPS?

Im saying that if you cannot install it via snap, maybe you can install it via pip (certbot.eff.org -> system:other -> software:pip) or use another acme client.

And it's not "any VPS" it's "Ubuntu CORE", maybe :smiley:

1 Like

That worked until I installed the apache plugin, which did install with no problem. After that I got the error again (see above). The link you provided describes a snapd installation which of course I can't use. Sorry I missed your ->. Let me try pip and see what happens.

Did you try these instead? Certbot Instructions | Certbot

NB: the Apache plugin might be in another pypi package: certbot-apache ยท PyPI

1 Like

I'm working on the pip install now. So far I'm having trouble creating the venv. I'll see if I can work it out.

When I run this: sudo python3 -m venv /opt/certbot/
I get this: Command '['/opt/certbot/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
The directory /opt/certbot/ does not exist. How do I solve this?

/rant do you have an actual reason to use Ubuntu CORE instead of regular Ubuntu?

1 Like

The error log you've posted, is that from before or after you've installed python3-certbot-apache? Because it does not mention lsb_release but does return an error about the plugin not being installed. So my guess is this log is from before the plugin was installed.

Can you provide the most recent log?

2 Likes

9peppe: I'm running a ubuntu 20.04 VPS on hostinger. I'm using what they installed on my VPS. I have no personal preference.

1 Like

Osiris: Right now I'm trying to create a python3 venv per the instructions given by 9peppe and it fails. If I can get through this I'll try that install again and get you a better log. The log I had was HUGE so I truncated it hoping to retain what was pertinent.