1

I am getting this error each time I run the cron. When I saw the status report I found last time cron was run was about 8 weeks ago. It is same for all the 3 websties that I host with the same server, shored hosting. when I tried to run cron manually, it ended with a message cron failed. Somewhere I read it possible reason could be /tmp folder, so I created a tmp folder in installation directory for all the three websites. It did work for one of the websites, I am able to run cron manually in that website. But for other two websites it was the same error. A discussion in drupal.org told it could be problem with cron_semaphore variable. I tried deleting cron_semaphore variable using phpmyadmin and cleared the cache, but still it is same problem. Sometimes when I try it manually , it gives error message that MYSQL has gone away from query while inserting data into watchdog. Is it because of the MySQL or file permissions problem ? Can it be cured if I update core to latest version? Or should I contact the hosting provider, is there is a problem with them?

3

There are too many factors that can stop the cron from being executed.

To see where exactly it breaks, open includes/module.inc and at the line 496 (function module_invoke_all()) add this:

foreach (module_implements($hook) as $module) {
  $function = $module .'_'. $hook;

  // This is the line you should add:
  if ($hook == 'cron') watchdog('cron debug', "Cron is processing module: $module");

Then run the cron from admin. The last module to be called is the one which breaks. Look further into the implementation of hook_cron() of that module and debug further.

This is inspired by this comment.

See this discussion.

2
  • disabled the page cache, block cache, page comopression, css & javascript optimization in other two sites and cleared the cache. One site was able to run the cron successfully. The other one failed, when I searched the error message, it wasn't able to insert the update string got from the update status module. Disabled the update status module and it was able to run cron successfully too. Don't know what could be the exact reason, but none of the sites have any custom module, all the modules installed are the downloaded modules from durpal.org only Sep 28 '12 at 11:02
  • Hack temporarily the <code>hook_cron()</code> implementation in update module and debug it on each step to see where exactly it fails. Sep 28 '12 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.