I've have searched on this for hours...

So I've got a large website that's updated with new nodes all the time, and I'm also using aggregator and have 4 different feeds being imported into the site and displayed using views.

For some reason my cron will not run automatically. It used to work but not any more. For example I just went into cron and it was last run 6 days and 21 hours ago (when I did it manually)

It's fine manually ie if I click the 'Run cron' button it works.

I tried poormanscron with no luck. and have had ultimate cron installed for the past week with each job set to run and different intervals e.g. aggregator should now run every minute. But still no luck.

There are no log messages for cron either.

The site is on a client's own hosting account - shared reseller with Fast Hosts. Cron runs fine on all of their other sites though.

Any help is greatly appreciated as none of my aggregator feeds are being kept up to date.

Cheers

Comments

mansigajjar’s picture

Hello,

Can you please tell which OS installed on your hosting server?

carlbowles100’s picture

Hi it's a Linux OS on an nginx server. It's just on a basic shared hosting server.

carlbowles100’s picture

Hi, it's a Linux OS on an nginx server. It's just on a basic shared hosting server.

carlbowles100’s picture

I've tried easy cron but keep getting an email from them to say cron run failed, so external crons aren't working either.

Cron works when I click run cron, it's literally just not running automatically.

tiikeri’s picture

I have the same issue on a site recently, cron not running automatically both in local and in production. Other sites hosted on the same server are working fine.
I tried cron debug, but every single cron run ended fine.
If I try to run cron from cron.php + key I got a WSOD.

Didn't find a solution yet, soon I will try a debug in the meanwhile take a look at https://www.drupal.org/docs/7/setting-up-cron/troubleshooting-cron

I think I will try with external cron or contributed modules, take a look also in the install.txt file for information about cron.

tiikeri’s picture

Just to post back: I configured a cron job task on my shared hosting server (hosting support provider told me they support curl), but it doesn't work and got no errors log.
Anyway I think this could be some resource issue, since I have some jobs scheduled to execute on cron run.
Finally I fixed it by configuring easycron. It should be quite easy but there is also a module that make it even more simple: https://www.drupal.org/project/easycron

carlbowles100’s picture

Thank you for your reply, I have installed and configured EasyCron again, so going to wait to see it Cron runs from now

carlbowles100’s picture

Having had Easy Cron installed for the last week, this option isn't working for me either.

At first with Easy Cron, under System > Cron it would say cron last run X amount of minutes ago and seemed to be working. The next day I got an email from Easy Cron saying it had 2 consecutive failures. Cron hasn't run since.

Seems to be somthing from stopping Cron running at all on my website whether it's Drupal's cron or Easy Cron.

All my other sites on the same shared hosting servers work fine

tiikeri’s picture

Have you tried Cron Debug yet?
It splits all cron functions running in your site and log each function in the watchdog. When cron run and didn't execute completely you can see where the process stop. Else, you should have to disable each cron task one by one to find the task not working.
You can see also how many cron functions you have on the site.

unfortunately debugging cron could take long time, I was lucky to solve it just by configuring easycron.
good luck!

VM’s picture

IIRC poorman's cron utilizes anon traffic to trigger cron. If you don't have traffic at the time the job is supposed to fire then it won't fire.

I suggest setting up a cron job on the server instead of via drupal (ie: set up a formal cron job). IIRC its more efficient than running via the script itself.

your hosts documentation:
https://help.fasthosts.co.uk/app/answers/detail/a_id/2198/~/setting-up-c...

msupko’s picture

I recently had a Drupal 7 site that was experiencing this issue (cron ran fine by hand, but refused to run automatically), and I tracked it down to the install_task variable. Basically, core Drupal will not run cron if install_task is not equal to 'done'. This is to ensure cron doesn't fire off automatically while site installation is in progress.

However, if, as in my case, you have a migrated site, or one built on a problematic install profile, this can totally happen.

I just cast one 'drush vset install_task done' and viola, our cron woes were gone.

See system_run_automated_cron() in system.module for more details.

shinyash’s picture

Thank you for this suggestion! 
I had the same issue with Cron not triggering correctly when hitting the cron_key URL.

Checking and changing the install_task to "done" fixed it perfectly.

mukila’s picture

After updated the install_task variable, the cron started run automatically. Thanks for your answer.

kosef’s picture

Thas is weird, cron should run perfectly