Problem when adding a certificate on nginx

I use nginx, and when I try to add a certificate this error comes out. Does anyone know what the problem is?

Error: Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-8" --agree-tos --authenticator webroot --email "blijonasq@gmail.com" --preferred-challenges "dns,http" --domains "bitwarden.didziojipilis.eu" 
Traceback (most recent call last):
  File "/usr/local/bin/certbot", line 5, in 
    from certbot.main import main
  File "/usr/local/lib/python3.7/dist-packages/certbot/main.py", line 6, in 
    from certbot._internal import main as internal_main
  File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/main.py", line 28, in 
    from certbot import crypto_util
  File "/usr/local/lib/python3.7/dist-packages/certbot/crypto_util.py", line 42, in 
    from certbot import interfaces
  File "/usr/local/lib/python3.7/dist-packages/certbot/interfaces.py", line 21, in 
    from acme.client import ClientBase
ImportError: cannot import name 'ClientBase' from 'acme.client' (/usr/local/lib/python3.7/dist-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)

Yes, the issue is that Certbot was installed using global pip on this server. Installing Python packages globally like this is very brittle and we strongly recommend that you don't do it.

Alternative installation methods are:

More precisely, the versions of these Python modules need to be in sync:

  • acme
  • certbot
  • certbot-nginx
4 Likes

That said, I also think you may need to deal with the DNS issue:
1.1.1.1 can't find bitwarden.didziojipilis.eu: Non-existent domain

Maybe not to obtain the cert - you could use DNS-01 authentication for that.
But, when you go to use the cert, without a DNS entry it may be a bit difficult.

3 Likes

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