Autorenewal not working, Nginx, debian buster-slim, docker container, certbot 0.31.0

Docker container installs cron, does not install or use systemd. cron is stood up using supervisord.

contents of /etc/cron.d/certbot as found:
0 */12 * * * root test -x /usr/bin/certbot -a ! -d /run/systemd/system && perl -e ‘sleep int(rand(43200))’ && certbot -q renew

From the command line certbot renew --dry-run works just fine and uses webroot.

It does not look like the command in the crontab works: /usr/bin/certbot -a ! -d /run/systemd/system && perl -e ‘sleep int(rand(43200))’ && certbot -q renew

fails with: “The requested ! plugin does not appear to be installed”

2019-09-21 17:25:06,256:DEBUG:certbot.main:certbot version: 0.31.0
2019-09-21 17:25:06,257:DEBUG:certbot.main:Arguments: [’-a’, ‘!’, ‘-d’, ‘/run/systemd/system’]
2019-09-21 17:25:06,257:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2019-09-21 17:25:06,267:DEBUG:certbot.log:Root logging level set at 20
2019-09-21 17:25:06,267:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2019-09-21 17:25:06,269:DEBUG:certbot.plugins.selection:Requested authenticator ! and installer None
2019-09-21 17:25:06,435:DEBUG:certbot.plugins.selection:Single candidate plugin: * nginx
Description: Nginx Web Server plugin
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: nginx = certbot_nginx.configurator:NginxConfigurator
Initialized: <certbot_nginx.configurator.NginxConfigurator object at 0x7f5db80ea978>
Prep: True
2019-09-21 17:25:06,436:DEBUG:certbot.plugins.selection:No candidate plugin
2019-09-21 17:25:06,436:DEBUG:certbot.plugins.selection:Selected authenticator None and installer <certbot_nginx.configurator.NginxConfigurator object at 0x7f5db80ea978>

It looks like it’s trying to use the nginx plugin but its not installed because the site is configured to use webroot.

How do I fix it?


1 Like

I wouldn't have thought it matters, but does your file really contain "-a ! -d"? And not "-a \! -d"?

The Ubuntu package's /etc/cron.d/certbot contains -- along with a block of comments:


0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew

Are you trying to run that command in a shell, or is the cron job executing it?

It's not the command in the cron job. The cron job executes three commands:

test -x /usr/bin/certbot -a \! -d /run/systemd/system
perl -e 'sleep int(rand(43200))'
certbot -q renew

It doesn't run "/usr/bin/certbot -a \! -d /run/systemd/system" or "/usr/bin/certbot -a ! -d /run/systemd/system".

1 Like

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