Error when adding ssl certificate on nginx

When I try to add a certificate I get an internal error which outputs: (page opens with http, but bitwarden does not allow registering on http)

Error: Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-15" --agree-tos --authenticator webroot --email "vetezz@gmail.com" --preferred-challenges "dns,http" --domains "bitwarden.vete.space" 
Traceback (most recent call last):
  File "/usr/bin/certbot", line 5, in 
    from certbot.main import main
  File "/opt/certbot/lib/python3.7/site-packages/certbot/main.py", line 6, in 
    from certbot._internal import main as internal_main
  File "/opt/certbot/lib/python3.7/site-packages/certbot/_internal/main.py", line 28, in 
    from certbot import crypto_util
  File "/opt/certbot/lib/python3.7/site-packages/certbot/crypto_util.py", line 42, in 
    from certbot import interfaces
  File "/opt/certbot/lib/python3.7/site-packages/certbot/interfaces.py", line 21, in 
    from acme.client import ClientBase
ImportError: cannot import name 'ClientBase' from 'acme.client' (/opt/certbot/lib/python3.7/site-packages/acme/client.py)

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Hello @Vete, welcome to the Let's Encrypt community. :slightly_smiling_face:

It looks like a Python component is missing; please see https://certbot.eff.org/
generally the snap method of installing Certbot is the preferred method.

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:

I ran this command:

It produced this output:

My web server is (include version):

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

My hosting provider, if applicable, is:

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

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

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):

Thank you for assisting us in helping YOU!

1 Like

My domain is: bitwarden.blijonas.space

I ran this command: 'Add Let's Encrypt Certificate' on nginx

It produced this output:

Error: Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-n - Pastebin.com

My web server is (include version): nginx v2.9.20

The operating system my web server runs on is (include version): Ubuntu Server 22.04.2 LTS

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): yes (nginx v2.9.20)

1 Like

Yet you are are using Certbot, see:

1 Like

I didn't really know what it was asking me the control panel part so I didn't know what to put there so I wrote nginx.

1 Like

I do not know that command, others here may very well know; so forgive my ignorance when I as is that a GUI Control Panel of some sort? Possibly related to Bitwarden?

I see that I didn't provide the info correctly. I use the nginx proxy manager:

1 Like

I would not say that; but the addition information is valuable! :slight_smile:

At this point, kindly wait for more knowledgeable Let's Encrypt community volunteers to assist.

1 Like

I have managed to get the error output to this:

Error: Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-1" --agree-tos --authenticator webroot --email "blijonasq@gmail.com" --preferred-challenges "dns,http" --domains "bitwarden.blijonas.space" 
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Some challenges have failed.
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.

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Please attach the above log file in a post to this thread.

2 Likes

I don't know why but its not generating one...
Screenshot_3

NPM is not a very good piece of software.
That said, I don't think that is where your biggest problem lies.
To confirm my suspicions, riddle me this:
Have you been able to use certbot on this system to obtain any cert?
If not, then I suspect you have not properly installed certbot.
Please follow the recommended installation instructions (for Ubuntu 20), at:
Certbot (eff.org)

2 Likes

This is my first time trying to obtain a cert on this system, and when I try to run this command which is a part of the installation process: sudo certbot --nginx I get an error saying this:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.")

Here is the log file contents:

2023-03-16 16:36:10,560:DEBUG:certbot._internal.main:certbot version: 2.4.0
2023-03-16 16:36:10,561:DEBUG:certbot._internal.main:Location of certbot entry point: /usr/local/bin/certbot
2023-03-16 16:36:10,561:DEBUG:certbot._internal.main:Arguments: ['--nginx']
2023-03-16 16:36:10,562:DEBUG:certbot._internal.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#m>
2023-03-16 16:36:10,613:DEBUG:certbot._internal.log:Root logging level set at 30
2023-03-16 16:36:10,616:DEBUG:certbot._internal.plugins.selection:Requested authenticator nginx and install>
2023-03-16 16:36:10,621:DEBUG:certbot._internal.plugins.disco:No installation (PluginEntryPoint#nginx): Cou>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/certbot/_internal/plugins/disco.py", line 111, in prepare
    self._initialized.prepare()
  File "/usr/local/lib/python3.10/dist-packages/certbot_nginx/_internal/configurator.py", line 194, in prep>
    raise errors.NoInstallationError(
certbot.errors.NoInstallationError: Could not find a usable 'nginx' binary. Ensure nginx exists, the binary>
2023-03-16 16:36:10,638:DEBUG:certbot._internal.plugins.selection:No candidate plugin
2 Likes

I'm following the instructions but I get this error when I type this command: sudo certbot --nginx

The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.")

Then there is more to the problem...
Perhaps:

  • nginx was installed unconventionally [not via apt]
  • multiple versions of certbot exist [previous version remains installed]
  • python was installed unconventionally [not via apt]
  • the certbot default .ini file contains incorrect settings

Maybe you could try another ACME client, like: acme.sh

2 Likes

Well, that's quite the understatement…

4 Likes

LOL again :rofl:

2 Likes

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