Fails when running cronjob

Hi,

I have letsencrypt setup and working manually on the command line, it’s apache 2.4 on Debian 8.2.

I am trying to run the command in a monthly cronjob:

/root/letsencrypt/letsencrypt-auto -d www.example.com -d example.com --renew-by-default --hsts --redirect

But it fails with:

No installers seem to be present and working on your system; fix that or try running letsencrypt with the "certonly" command.

I’ve run the command manually again, and it works, but I do get a warning Unable to set enhancement redirect for.... But that shouldn’t matter, right? There must be something present in my login shell which is missing when I run the cronjob. Any idea what it could be?

Thanks,

Dan

A command within the script might be relying on a path which isn’t defined.

It could well be something like this - but lots of other people seem to have it working when running from a cronjob.

2016-01-01 00:00:25,450:DEBUG:letsencrypt.cli:Root logging level set at 30 2016-01-01 00:00:25,453:INFO:letsencrypt.cli:Saving debug log to /var/log/letsencrypt/letsencrypt.log 2016-01-01 00:00:25,454:DEBUG:letsencrypt.cli:letsencrypt version: 0.1.1 2016-01-01 00:00:25,454:DEBUG:letsencrypt.cli:Arguments: ['-d', 'www.example.com', '-d', 'example.com.org', '--renew-by-default', '--hsts', '--redirect'] 2016-01-01 00:00:25,455:DEBUG:letsencrypt.cli:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#webroot,PluginEntryPoint#null,PluginEntryPoint#manual,PluginEntryPoint#standalone) 2016-01-01 00:00:25,464:DEBUG:letsencrypt.cli:Requested authenticator None and installer None 2016-01-01 00:00:25,472:DEBUG:letsencrypt.plugins.disco:No installation (PluginEntryPoint#apache): Traceback (most recent call last): File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/disco.py", line 103, in prepare self._initialized.prepare() File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 142, in prepare raise errors.NoInstallationError NoInstallationError 2016-01-01 00:00:25,473:DEBUG:letsencrypt.display.ops:No candidate plugin 2016-01-01 00:00:25,474:DEBUG:letsencrypt.cli:Selected authenticator None and installer None

This same error I also have right now. When it is ran manually or from cron, the difference is:

CRON

2016-04-18 11:55:02,503:DEBUG:letsencrypt.plugins.selection:Requested authenticator None and installer None
2016-04-18 11:55:02,508:DEBUG:letsencrypt.plugins.disco:No installation (PluginEntryPoint#apache):

MANUALLY

2016-04-18 11:59:01,788:DEBUG:letsencrypt.plugins.selection:Requested authenticator None and installer None
2016-04-18 11:59:04,011:DEBUG:letsencrypt.plugins.selection:Single candidate plugin: * apache

The command is the same:

cd /home/user/repositories/letsencrypt && ./letsencrypt-auto -c /etc/letsencrypt/cli.ini -d www.myexample.com > /dev/null

Manually it works fine, but it does not work when the command is ran by cron…

Anyone has a solution for this?

Get the latest letsencrypt client, then you can use:

letsencrypt renew

Thank you very much! That works like a charm! I always thought renewal is also done with the standard ‘./letsencrypt-auto’ command.