Server doesn't update certificates automatically

So, we have a cron job to run every morning, thinking that it was auto-renewing the certificates. However, yesterday we hit the 90 days and discovered that they weren’t updated. I’ve done this manually (logging in to shell and running certbot-auto to configure them), which works fine. However, the cron job doesn’t.

Here’s an error from the log file -

2018-01-23 03:37:04, renew, less than 30 days before certificate expiry 2018-02-12 09:59:34 UTC.
2018-01-23 03:37:04,285:INFO:certbot.renewal:Cert is due for renewal, auto-renewing...
2018-01-23 03:37:04,300:DEBUG:certbot.plugins.selection:Requested authenticator nginx and installer nginx
2018-01-23 03:37:04,312:DEBUG:certbot.plugins.disco:No installation (PluginEntryPoint#nginx):
Traceback (most recent call last):
  File "/opt/", line 130, in prepare
  File "/opt/", line 150, in prepare
    raise errors.NoInstallationError
2018-01-23 03:37:04,314:DEBUG:certbot.plugins.selection:No candidate plugin
2018-01-23 03:37:04,314:DEBUG:certbot.plugins.selection:No candidate plugin
2018-01-23 03:37:04,314:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None
2018-01-23 03:37:04,314:INFO:certbot.main:Could not choose appropriate plugin: The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError()
2018-01-23 03:37:04,315:WARNING:certbot.renewal:Attempting to renew cert ( from /etc/letsencrypt/renewal/ produced an unexpected error: The nginx plugin is not working; there may be probl\
ems with your existing configuration.
The error was: NoInstallationError(). Skipping.
2018-01-23 03:37:04,322:DEBUG:certbot.renewal:Traceback was:
Traceback (most recent call last):
  File "/opt/", line 425, in handle_renewal_request
    main.renew_cert(lineage_config, plugins, renewal_candidate)
  File "/opt/", line 736, in renew_cert
    installer, auth = plug_sel.choose_configurator_plugins(config, plugins, "certonly")
  File "/opt/", line 201, in choose_configurator_plugins
    diagnose_configurator_problem("authenticator", req_auth, plugins)
  File "/opt/", line 297, in diagnose_configurator_problem
    raise errors.PluginSelectionError(msg)
PluginSelectionError: The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError()

Would this be a problem with certbot-auto (not being happy with the nginx plugin)? How do I check if I have the nginx plugin installed and that it’s working?

Hi @kabads,

What command is run from your cron job to perform the renewal? What command did you run that caused the renewal to work successfully?

cron job is:

37 3 * * * /usr/local/bin/certbot-auto renew --no-self-upgrade --post-hook "systemctl reload nginx"

and the manual command was:

certbot-auto --no-self-upgrade renew

What is it about the cron version that might not make it work? Does the --no-self-upgrade prevent it from running if it’s out of date?

Hi @kabads,

I checked in with my colleagues and found out that this means that your nginx binary is not in the PATH when you’re running from crontab, but it is in your PATH when you’re running on the command line.

You can probably find out what the directory in question is by running which nginx on the command line. It’s also possible to declare a PATH in crontab.

Thank you @schoen - I was looking at paths from other posts and came up with this as a script:

/usr/local/bin/certbot-auto renew --nginx --no-self-upgrade 

However, I’ve just run this via cron, and I’m not getting anything in the log files.

Like not at all in /var/log/letsencrypt?

By the way, renew --nginx is not a good idea. renew already remembers what method you used to authenticate before. You don’t want to change the authentication method just because you’re doing a renewal. (However, that’s not related to your question.)

/var/log/letsencrypt/letsencrypt.log exists and has an entry from me running the command earlier today - but nothing from the cron jobs, that refer to the script - the cron jobs are running as they are listed in /var/log/syslog. Very strange.

I’ll take out the reference to --nginx.

You could try adding a touch /tmp/$$ to your script or something so you can see side effects to confirm whether it’s running.

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