Cron Task Fails

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:


I ran this command:
Cron root@triggerfish python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q

It produced this output:
python: Command not found.
My web server is (include version):
apache 2.4
The operating system my web server runs on is (include version):
FReeBSD 12.1
My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know):
yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):

certbot 1.7.0

What's the output of whereis python?

2 Likes

python: /usr/ports/lang/python

which, duh , means not installed

1 Like

How can you use certbot without Python installed? :thinking:

1 Like

I dont know
thats was the result

You need to have Python installed to use certbot.

If it is really installed in /usr/ports/lang, that might not be in the default PATH for cron so it might not check there when trying to run the cron job.

The particular command here (before the &&) is not running Certbot: it's just trying to add a random delay so that different Certbot users around the world don't all try to renew at the same second. You could remove the part before the && or change the command before the && to sleep followed by some number of your choice (just so the exact time of renewal attempts will be different from other people's machines).

1 Like

I don't think it's installed there, as @kasdivi already pointed out. That's just how ports works: you cd to the software package under /usr/ports/... and there you run make install clean to install the package. See Chapter 4. Installing Applications: Packages and Ports | FreeBSD Documentation Portal for more info.

I think somewhere along the way Python was removed from this system, breaking certbot in the process. Or at least the current cronjob, which wasn't a problem before I assume. And without a working Python, certbot obviously won't work too.

It might even be possible certbot has been removed too, we don't really know, as the certbot command won't run if the python delay part of the cronjob fails. However, it seems you can remove dependencies quite easily with Ports:

If the port has any applications that depend upon it, this information will be displayed but the uninstallation will proceed.

So perhaps it's just Python which has been removed.

I show thw following

py37-certbot

py37-certbot-apache

as installed packages

Try reinstalling them again ... ?

certbot appears o be working fine except for auto update

1 Like

Is there a different cron job that runs it?
sudo crontab -l

Is there a newer version for FreeBSD?
If so, can you uninstall/reinstall the latest version manually?

not sure i want to mess with the server Will look at tweaking the script.

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