Cron Job fails with "No such file or directory" error

Hi, I have attempt to get this right over weeks now. I have even done separate installations but could not get to work on either.

The current IP installation is on a sub-domain, but I have also tried installing into a sub-folder.

Accessing the path below in the browser give a blank page, which is sign that it works, but via then cron job it just does now work and throws the error below all the time.

ERROR: “/usr/local/cpanel/bin/jailshell: https://wakaitu.invoicenamibia.com/index.php/invoices/cron/recur/MYCRONKEY: No such file or directory”

I am on v1.5.9, but I have also tried it on 1.5.10.

Thank you for assisting.

May you want to tell me in which sub directory you installed?

I have installed into sub-domain “https://wakaitu.invoicenamibia.com”. hence the path I set in cron job is: https://wakaitu.invoicenamibia.com/index.php/invoices/cron/recur/MYCRONKEY

When I call the Link https://wakaitu.invoicenamibia.com/invoices/cron/recur/MYCRONKEY

I get the following result: Wrong cron key!

So in fact this is working you should replace MYCRONKEY with your actual Cron Key

Hi Martin,

Yes, the path is correct and when I load it with the correct key it gives me a blank page, however when I pass the path into the CRON job, the CRON job executes but it is unable to resolve the path and throws the ERROR: “/usr/local/cpanel/bin/jailshell: https://wakaitu.invoicenamibia.com/index.php/invoices/cron/recur/MYCRONKEY: No such file or directory”

I can not debug this from here, but pls provide some more infos:

  • Which user owns the installation folder (and its subfolders & files)?
  • Under which user is the cron getting executed?
  • How exactly is your CronJob?

Pls tell me how exactly your CronJob looks and I will assist you.
And gaving a white screen when the cron is executed is 100% normal, as its a backgroundtask where you do not get any output unless there is somthing not working properly.

Like at a good CLI which just calls back with an error if something is wrong.

Hi Martin_Anonym,

I am not sure I understand your question about the users. But I would believe all the folders and are owned by the logged in cPanel user.

I will be willing to provide access to cPanel, if that can be an option.

Well thats wrong. Or at least I can not see the needed Parts there.

Normaly you really should NOT set up crons in any “GUI” but in the shell/console.

And pls delete the pic as it shows your Cron-Key.

login in your Server with the user owning the application.

# crontab -e
then add:

*/5 * * * * wget -O - https://wakaitu.invoicenamibia.com/index.php/invoices/cron/recur/your-cron-key >/dev/null 2>&1

or

*/5 * * * * curl -o "https://wakaitu.invoicenamibia.com/index.php/invoices/cron/recur/your-cron-key" >/dev/null 2>&1

Now save the file and wait for execution.

You are now just executing the link but you dont tell the Cron what to do with it. You dont tell how or with what it should get called. A Link itself is not a command. But in the command-field of your cron is just a link

Pls read this part of the docs LINK

Short:

Change your “command” of the cron to

  1. if wget is installed
    wget -O - https://wakaitu.invoicenamibia.com/index.php/invoices/cron/recur/your-cron-key >/dev/null 2>&1

  2. if curl is installed
    curl -o "https://wakaitu.invoicenamibia.com/index.php/invoices/cron/recur/your-cron-key" >/dev/null 2>&1

Also you should ask yourself if you want to run this command every 5 mins, which is a bit aggressive for a task like this. The Wiki recommends once a day, which is ok, I would go for once a day at a spezific time like 9am (9:00), thats totally ok. As the cron does just affect recurring Invoices and when they get send out. You definitely dont have to check that every 5 mins as they are timed on days mostly.

Hi Martin_Anonym

Aha… Thank you so much… All working now.

I really appreciated your assistance.

Your welcome.
Just saw someone HERE had th exact same issue, but now its fixed anyway.

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