Infomaniak/certbot-dns-infomaniak

AttributeError: module 'certbot.plugins.common' has no attribute 'TLSSNI01'

Closed this issue · 2 comments

Hello,
First of all, thank you for taking the time to create this :) I stumbled upon it randomly while trying to see if someone created it only a few hours after you created the repo.

Now, I am using v0.1.7, but when I follow your instructions, I get the following error (I of course used my own address instead of death.star):

> sudo certbot certonly --authenticator certbot-dns-infomaniak:dns-infomaniak --server https://acme-staging-v02.api.letsencrypt.org/directory --agree-tos --rsa-key-size 4096 -d 'death.star'
An unexpected error occurred:
AttributeError: module 'certbot.plugins.common' has no attribute 'TLSSNI01'

The log file explaining the error contains:

2021-01-11 19:32:19,204:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
  File "/usr/local/bin/certbot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/certbot/main.py", line 15, in main
    return internal_main.main(cli_args)
  File "/usr/local/lib/python3.8/dist-packages/certbot/_internal/main.py", line 1383, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
  File "/usr/local/lib/python3.8/dist-packages/certbot/_internal/plugins/disco.py", line 236, in find_all
    plugin_ep = cls._load_entry_point(entry_point, plugins, with_prefix=False)
  File "/usr/local/lib/python3.8/dist-packages/certbot/_internal/plugins/disco.py", line 254, in _load_entry_point
    plugin_ep = PluginEntryPoint(entry_point, with_prefix)
  File "/usr/local/lib/python3.8/dist-packages/certbot/_internal/plugins/disco.py", line 56, in __init__
    self.plugin_cls = entry_point.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/certbot_apache/entrypoint.py", line 8, in <module>
    from certbot_apache import configurator
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 35, in <module>
    from certbot_apache import http_01
  File "/usr/lib/python3/dist-packages/certbot_apache/http_01.py", line 17, in <module>
    class ApacheHttp01(common.TLSSNI01):
AttributeError: module 'certbot.plugins.common' has no attribute 'TLSSNI01'
2021-01-11 19:32:19,204:ERROR:certbot._internal.log:An unexpected error occurred:
2021-01-11 19:32:19,205:ERROR:certbot._internal.log:AttributeError: module 'certbot.plugins.common' has no attribute 'TLSSNI01'

From what I have found online, it might come from the fact that I have certbot and python3-certbot-apache installed both from apt and from the dependencies of your code. Could that be the case?

Here is what I have installed from pip3:

  • certbot-dns-infomaniak in /usr/local/lib/python3.8/dist-packages (0.1.7)
  • setuptools in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (45.2.0)
  • mock in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (3.0.5)
  • certbot>=1.0.0 in /usr/local/lib/python3.8/dist-packages (from certbot-dns-infomaniak) (1.11.0)
  • requests-mock in /usr/local/lib/python3.8/dist-packages (from certbot-dns-infomaniak) (1.8.0)
  • requests in /usr/lib/python3/dist-packages (from certbot-dns-infomaniak) (2.22.0)
  • ConfigArgParse>=0.9.3 in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (0.13.0)
  • parsedatetime>=1.3 in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (2.4)
  • pytz in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (2019.3)
  • pyrfc3339 in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (1.1)
  • zope.component in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (4.3.0)
  • configobj in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (5.0.6)
  • josepy>=1.1.0 in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (1.2.0)
  • cryptography>=1.2.3 in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (2.8)
  • distro>=1.0.1 in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (1.4.0)
  • zope.interface in /usr/lib/python3/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (4.7.1)
  • acme>=1.8.0 in /usr/local/lib/python3.8/dist-packages (from certbot>=1.0.0->certbot-dns-infomaniak) (1.11.0)
  • six in /usr/lib/python3/dist-packages (from requests-mock->certbot-dns-infomaniak) (1.14.0)
  • requests-toolbelt>=0.3.0 in /usr/lib/python3/dist-packages (from acme>=1.8.0->certbot>=1.0.0->certbot-dns-infomaniak) (0.8.0)
  • PyOpenSSL>=0.15.1 in /usr/lib/python3/dist-packages (from acme>=1.8.0->certbot>=1.0.0->certbot-dns-infomaniak) (19.0.0)

and from apt:

  • certbot/focal-updates,now 0.40.0-1ubuntu0.1 all [installed]
  • python3-certbot-apache/focal,now 0.39.0-1 all [installed]
  • python3-certbot/focal-updates,now 0.40.0-1ubuntu0.1 all [installed,automatic]

I am running Ubuntu 20.04.1.

Hello and thank you for your report, the new version fixes this issue: the requirement on certbot version was too high, and made pip install cerbot on top of the distribution installation causing unwanted behaviour.

Also you should now deinstall the deps installed via pip before upgrading