Infomaniak / certbot-dns-infomaniak

Infomaniak DNS Authenticator plugin for certbot
Apache License 2.0
32 stars 13 forks source link

Could not choose appropriate plugin: The requested dns-infomaniak plugin does not appear to be installed #22

Closed timotheeandres closed 5 months ago

timotheeandres commented 2 years ago

I am trying to use dns-01 to validate my certificates, but I cannot seem to have Certbot use the plugin to connect to Infomaniak.

I installed the package as listed:

$ pip install certbot-dns-infomaniak
Requirement already satisfied: certbot-dns-infomaniak in ./.local/lib/python3.8/site-packages (0.1.16)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (45.2.0)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (2.22.0)
Requirement already satisfied: idna in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (2.8)
Requirement already satisfied: requests-mock in ./.local/lib/python3.8/site-packages (from certbot-dns-infomaniak) (1.9.3)
Requirement already satisfied: mock in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (3.0.5)
Requirement already satisfied: certbot>=0.31.0 in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (0.40.0)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from requests-mock->certbot-dns-infomaniak) (1.14.0)

And I'm running the following command: sudo --preserve-env=INFOMANIAK_API_TOKEN certbot certonly --authenticator dns-infomaniak --server https://acme-v02.api.letsencrypt.org/directory --rsa-key-size 4096 -d <domain>

But the command fails, and the logs display this:

2022-07-23 11:11:15,584:DEBUG:certbot.main:certbot version: 0.40.0
2022-07-23 11:11:15,584:DEBUG:certbot.main:Arguments: ['--authenticator', 'dns-infomaniak', '--server', 'https://acme-v02.api.letsencrypt.org/directory', '--rsa-key-size', '4096', '-d', <domain>]
2022-07-23 11:11:15,585:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2022-07-23 11:11:15,592:DEBUG:certbot.log:Root logging level set at 20
2022-07-23 11:11:15,592:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2022-07-23 11:11:15,592:DEBUG:certbot.plugins.selection:Requested authenticator dns-infomaniak and installer None
2022-07-23 11:11:15,592:DEBUG:certbot.plugins.selection:No candidate plugin
2022-07-23 11:11:15,592:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None
2022-07-23 11:11:15,593:INFO:certbot.main:Could not choose appropriate plugin: The requested dns-infomaniak plugin does not appear to be installed
2022-07-23 11:11:15,593:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
  File "/usr/bin/certbot", line 11, in <module>
    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 1244, in certonly
    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 dns-infomaniak plugin does not appear to be installed

I performed a reboot of the server, to no avail.

Versions:

timotheeandres commented 1 year ago

In the meantime, I seem to have found a workaround:

jsponz commented 1 year ago

@timotheeandres I am following your workaround, but I still have the same message. Any help?

timotheeandres commented 1 year ago

My apologies, I did not update my message. It seems that this workaround stopped working at some point. Another solution I found was to use specifically the pip version of certbot, and to make sure to install the mock package as well: https://github.com/Infomaniak/certbot-dns-infomaniak/issues/26#issuecomment-1484165778

jsponz commented 1 year ago

Thanks. Still the same. I reviewed your instructions, but the same error. Could you give me your commands?

timotheeandres commented 1 year ago

Depending on your system, you might want to change pip to pip3, and use the corresponding packet manager instead of apt. Remember to download the proper web server extension if you need it (here I use nginx). Here is what I used:

sudo apt autoremove certbot
sudo pip install certbot certbot-nginx
sudo pip install mock
jsponz commented 1 year ago

Thanks! Same error :-(

Screenshot 2023-04-03 at 14 58 11
timotheeandres commented 1 year ago

As a last resort, did you try using certbot-dns-infomaniak:dns-infomaniak instead of certbot-dns-infomaniak? And could you re-run the command, with -v, and show here the result?

masterbuck commented 8 months ago

I have the exact same issue and no solution that I could find: installed certbot via snap on Fedora, then certbot-dns-infomaniak via pip3, and certbot can't find the plugin even though it appears in certbot plugins (and it worked a few months ago, maybe with a previous version of certbot?)

Any help appreciated! I can't create a new subdomain :(

reneluria commented 8 months ago

Yes, plugins and certbot have to be installed via pip3

masterbuck commented 8 months ago

Thanks for the reply, I just uninstall the snap version of certbot and installed the pip version using the instructions from https://certbot.eff.org/instructions?ws=nginx&os=pip and I get the exact same issue:

The requested dns-infomaniak plugin does not appear to be installed

With the logs saying: 2024-01-09 10:15:10,092:DEBUG:certbot._internal.plugins.selection:Requested authenticator dns-infomaniak and installer None 2024-01-09 10:15:10,092:DEBUG:certbot._internal.plugins.selection:No candidate plugin 2024-01-09 10:15:10,093:DEBUG:certbot._internal.log:Exiting abnormally: [...]

Any following idea? :)

masterbuck commented 8 months ago

Nevermind, my issue was with not installing the plugin inside the virtual environment, it works now :)

sudo /opt/certbot/bin/pip install certbot-dns-infomaniak

jsponz commented 8 months ago

@masterbuck thanks for the good news.

Could you share your steps? Thanks!

masterbuck commented 8 months ago

For the full shebang:

I installed certbot via pip using the official instructions: https://certbot.eff.org/instructions?ws=nginx&os=pip

I then installed certbot-dns-infomaniak within the virtual environment created for the occasion: sudo /opt/certbot/bin/pip install certbot-dns-infomaniak

I then followed the normal instructions from this GitHub:

export INFOMANIAK_API_TOKEN=bipboupboup

sudo --preserve-env=INFOMANIAK_API_TOKEN certbot certonly --authenticator dns-infomaniak --server https://acme-v02.api.letsencrypt.org/directory --agree-tos --rsa-key-size 4096 -d 'sub.domain.tld'

And this time it worked without issues!

jsponz commented 8 months ago

@masterbuck Thanks!