Certbot can't seem to get token via environment variable for duckdns plugin

I try to create a new cert in a docker container, and call certbot like

  /opt/certbot/bin/certbot certonly \
    --authenticator dns-duckdns \
    -d "$DUCKDNS_SUBDOMAIN.duckdns.org" \
    -m "$EMAIL" \
    --non-interactive --agree-tos \
    --config-dir /app/certbot/config \
    --work-dir /app/certbot/work \
    --logs-dir /app/certbot/logs

The environment variable DUCKDNS_TOKEN is properly set, but I still get this error:

2025-02-06 20:55:47 app-1  | Missing command line flag or config entry for this setting:
2025-02-06 20:55:47 app-1  | Input the path to your DuckDNS credentials INI file

I have been trying out various variations, including an empty ini file passed like:

--dns-duckdns-credentials /app/duckdns.ini

But then I get complains about a missing token in the INI file.

Am I holding it wrong ?

Thanks for any light someone might shed.
K

I think I figured it out. Docker by default installed version 1.3 of the plugin, which does not support this newfangled environment variables.

Weird, there's a tag v1.5 on the plugins Docker hub: https://hub.docker.com/r/infinityofspace/certbot_dns_duckdns/tags

And the hashes of the v1.5 docker image and the latest image are the same, so using the latest image should support the environment variable.

2 Likes

My docker image was built with buster-lite, that only supports python 3.7 and hence the 1.3 image. Hoever, even with bullseye-light and tag 1.5, I still run into problems, I get this error instead:

2025-02-06 22:02:11 Saving debug log to /app/certbot/logs/letsencrypt.log
2025-02-06 22:02:12 Encountered exception during recovery: certbot.errors.PluginError: 'NoneType' object has no attribute 'conf'
2025-02-06 22:02:12 'NoneType' object has no attribute 'conf'

I'll probably have a build time script that writes the environment into the init file (given that the critical cert files are in the container volume, it should be ok for the duckdns token as well), but if there's a known bug or fix I'd love to hear about it!

K

If you can post the entire trace, that would be helpful.

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