Skip to content

Problem with certbot version 2.0.0 #297

@maxwai

Description

@maxwai

linuxserver.io

Cerbot can't generate new certificates


Expected Behavior

The Cerbot should be able to genereate new certificates

Current Behavior

The Certbot fails while trying to generate certificates.

The Error message is following:

Generating new certificate
An unexpected error occurred:
AttributeError: module 'certbot.interfaces' has no attribute 'IAuthenticator'
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/certbot-log-0gvor5__/log or re-run Certbot with -v for more details.
ERROR: Cert does not exist! Please see the validation error above. Make sure you entered correct credentials into the /config/dns-conf/cloudflare.ini file.

Also here is the traceback from the certbot:

Traceback (most recent call last):
  File "/usr/bin/certbot", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.9/site-packages/certbot/main.py", line 19, in main
    return internal_main.main(cli_args)
  File "/usr/lib/python3.9/site-packages/certbot/_internal/main.py", line 1707, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
  File "/usr/lib/python3.9/site-packages/certbot/_internal/plugins/disco.py", line 208, in find_all
    cls._load_entry_point(entry_point, plugins)
  File "/usr/lib/python3.9/site-packages/certbot/_internal/plugins/disco.py", line 215, in _load_entry_point
    plugin_ep = PluginEntryPoint(entry_point)
  File "/usr/lib/python3.9/site-packages/certbot/_internal/plugins/disco.py", line 56, in __init__
    self.plugin_cls: Type[interfaces.Plugin] = entry_point.load()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2456, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.9/site-packages/certbot_plugin_gandi/main.py", line 14, in <module>
    @zope.interface.implementer(interfaces.IAuthenticator)
AttributeError: module 'certbot.interfaces' has no attribute 'IAuthenticator'
2022-11-21 19:51:03,004:ERROR:certbot._internal.log:An unexpected error occurred:
2022-11-21 19:51:03,004:ERROR:certbot._internal.log:AttributeError: module 'certbot.interfaces' has no attribute 'IAuthenticator'

Steps to Reproduce

  1. create a new docker container and add domains/subdomains where certificates need to be generated. Alternatively change the subdomains of an existing docker container and restart it, this will force swag to generate new certificates immediatly.
  2. On start certbot fails and the container doesn't start

Environment

OS: Unraid
CPU architecture: x86_64
How docker service was installed: Unraid, Community Apps Plugin

Command used to create docker container (run/create/compose/screenshot)

docker run
  -d
  --name='swag'
  --net='proxynet'
  -e TZ="Europe/Berlin"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME=<redacted>
  -e HOST_CONTAINERNAME="swag"
  -e 'EMAIL'=<redacted>
  -e 'URL'=<redacted>
  -e 'SUBDOMAINS'=<redacted>
  -e 'ONLY_SUBDOMAINS'='true'
  -e 'VALIDATION'='http'
  -e 'DNSPLUGIN'=''
  -e 'EXTRA_DOMAINS'=<redacted>
  -e 'STAGING'='false'
  -e 'DUCKDNSTOKEN'=''
  -e 'PROPAGATION'=''
  -e 'PUID'='99'
  -e 'PGID'='100'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='https://[IP]:[PORT:443]'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver-ls-logo.png'
  -p '180:80/tcp'
  -p '1443:443/tcp'
  -v '/mnt/user/appdata/swag':'/config':'rw'
  --cap-add=NET_ADMIN 'linuxserver/swag:1.32.0'

Temporary fix

Reverting to version 1.32.0 fixes the problem

Possible Reason

While searching the the source of the Bug I found this comment on the cerbot github: comment Link

There they are talking about the zope interface

I then looked at the release note for version 2.0.0: release notes

There I noticed following lines:

  • The zope based interfaces in certbot.interfaces have been removed in favor of the abc based interfaces found in the same module.
  • Certbot no longer depends on zope.

So I think the problem may come from that change

Docker logs

 [custom-init] No custom services found, skipping...
 s6-rc: info: service s6rc-oneshot-runner: starting
 s6-rc: info: service s6rc-oneshot-runner successfully started
 s6-rc: info: service fix-attrs: starting
 s6-rc: info: service 00-legacy: starting
 s6-rc: info: service 00-legacy successfully started
 s6-rc: info: service fix-attrs successfully started
 s6-rc: info: service legacy-cont-init: starting
 cont-init: info: running /etc/cont-init.d/01-envfile
 cont-init: info: /etc/cont-init.d/01-envfile exited 0
 cont-init: info: running /etc/cont-init.d/01-migrations
 [migrations] started
 [migrations] 01-nginx-site-confs-default: skipped
 [migrations] done
 cont-init: info: /etc/cont-init.d/01-migrations exited 0
 cont-init: info: running /etc/cont-init.d/10-adduser
 
 -------------------------------------
           _         ()
          | |  ___   _    __
          | | / __| | |  /  \
          | | \__ \ | | | () |
          |_| |___/ |_|  \__/
 
 
 Brought to you by linuxserver.io
 -------------------------------------
 
 To support the app dev(s) visit:
 Certbot: https://supporters.eff.org/donate/support-work-on-certbot
 
 To support LSIO projects visit:
 https://www.linuxserver.io/donate/
 -------------------------------------
 GID/UID
 -------------------------------------
 
 User uid:    99
 User gid:    100
 -------------------------------------
 
 cont-init: info: /etc/cont-init.d/10-adduser exited 0
 cont-init: info: running /etc/cont-init.d/11-folders
 cont-init: info: /etc/cont-init.d/11-folders exited 0
 cont-init: info: running /etc/cont-init.d/12-samples
 cont-init: info: /etc/cont-init.d/12-samples exited 0
 cont-init: info: running /etc/cont-init.d/13-nginx
 cont-init: info: /etc/cont-init.d/13-nginx exited 0
 cont-init: info: running /etc/cont-init.d/14-php
 cont-init: info: /etc/cont-init.d/14-php exited 0
 cont-init: info: running /etc/cont-init.d/15-keygen
 using keys found in /config/keys
 cont-init: info: /etc/cont-init.d/15-keygen exited 0
 cont-init: info: running /etc/cont-init.d/20-permissions
 cont-init: info: /etc/cont-init.d/20-permissions exited 0
 cont-init: info: running /etc/cont-init.d/30-test-run
 cont-init: info: /etc/cont-init.d/30-test-run exited 0
 cont-init: info: running /etc/cont-init.d/31-require-url
 cont-init: info: /etc/cont-init.d/31-require-url exited 0
 cont-init: info: running /etc/cont-init.d/40-folders
 cont-init: info: /etc/cont-init.d/40-folders exited 0
 cont-init: info: running /etc/cont-init.d/41-samples
 cont-init: info: /etc/cont-init.d/41-samples exited 0
 cont-init: info: running /etc/cont-init.d/42-fail2ban
 cont-init: info: /etc/cont-init.d/42-fail2ban exited 0
 cont-init: info: running /etc/cont-init.d/43-crontabs
 cont-init: info: /etc/cont-init.d/43-crontabs exited 0
 cont-init: info: running /etc/cont-init.d/45-nginx
 cont-init: info: /etc/cont-init.d/45-nginx exited 0
 cont-init: info: running /etc/cont-init.d/50-certbot
 Variables set:
 PUID=99
 PGID=100
 TZ=Europe/Berlin
 URL=<redacted>
 SUBDOMAINS=<redacted>
 EXTRA_DOMAINS=<redacted>
 ONLY_SUBDOMAINS=true
 VALIDATION=http
 CERTPROVIDER=
 DNSPLUGIN=
 EMAIL=<redacted>
 STAGING=false
 
 Using Let's Encrypt as the cert provider
 SUBDOMAINS entered, processing
 SUBDOMAINS entered, processing
 Only subdomains, no URL in cert
 Sub-domains processed are:  <redacted>
 EXTRA_DOMAINS entered, processing
 Extra domains processed are:  <redacted>
 E-mail address entered: <redacted>
 http validation is selected
 Different validation parameters entered than what was used before. Revoking and deleting existing certificate, and an updated one will be created
 An unexpected error occurred:
 AttributeError: module 'certbot.interfaces' has no attribute 'IAuthenticator'
 Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/certbot-log-gmtusk52/log or re-run Certbot with -v for more details.
 Generating new certificate
 An unexpected error occurred:
 AttributeError: module 'certbot.interfaces' has no attribute 'IAuthenticator'
 Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/certbot-log-ssf57spu/log or re-run Certbot with -v for more details.
 ERROR: Cert does not exist! Please see the validation error above. The issue may be due to incorrect dns or port forwarding settings. Please fix your settings and recreate the container

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions