Jump to content

False Cron Warning?


Isaac Asher

Recommended Posts

In my System Health Status screen, there is one red item needing attention System Cron Tasks.  It says it does not appear to have completed successfully within the last 24 hours.  When I go to Setup --> Automation Settings, I have the green box at the top of the page that says Cron Status Ok, and that it last ran at 3:47am this morning.  

How can I make the warning go away if the cron is actually running successfully?  

Can someone shed some light on this?  Thanks much!!

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

Hello Isaac,

I can confirm this isn't a false warning.

The box you find at `Setup -> Automation Settings` will only indicate the last time the cron ran, even if no tasks were performed. The issue highlighted at `Help -> System Health Status` means that whilst the cron is running, it was unable to complete all it's daily automation tasks, which it will attempt to do at the time specified on the Automation Settings page.

The first part of troubleshooting this would be to ensure the cron is running, which you have confirmed, so, the next step is check it's running every 5 minutes, or at least once in the hour your cron attempts to perform it's daily automation tasks, which again you can check the time it does this on the Automation Settings page.

If the cron is running during this hour, it means it's starting but unable to complete all the tasks, so you will want to manually force the cron to run from the command line interface on your server using the `--force` and `-vvv` options. The force option will force the execution of tasks, regardless of "due" or "in progress" state and the vvv option will provide a verbose output on screen. Given that we expect an error here, before doing this, please navigate to `Setup -> General Settings -> Other` and tick `Display Errors`.

The command you are looking to execute in the CLI will be this:

php -q /path/to/crons/cron.php --force -vvv

You just need to replace /path/to/crons with the actual path to your crons directory.

Please don't hesitate to post the output back into this thread and I will advise further.

We also have a collection of common errors on this page: https://docs.whmcs.com/Cron_Job_Issues

Link to comment
Share on other sites

Thank you so much, Alex! I appreciate your detailed response, however I am somewhat limited. I do not have access to the command line on the server as it is shared hosting. I don't believe there is a way to run commands through cPanel, so I dug into WHMCS documentation more (thanks for the link).  Without command prompt access, I went to Setup --> General Settings --> Other tab and ticked the Display Errors option.  Successfully saved settings, and then navigated the browser to /whmcs/crons/cron.php but it just gave me a blank white window.  No output at all. 

 

Hope that's helpful.  Thank you so much!

Link to comment
Share on other sites

I reviewed my cron settings in cPanel once again and found that it was not set to run every five minutes.  Once I updated that, then I began receiving the automated emails from WHMCS telling me everything completed successfully.  Warning in WHMCS about the cron job is now resolved. 

Thanks everyone for your help!!!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated