Tuesday, June 5

Troubleshooting Drupal Cron

 Faced a couple of Problems in cron.
1. Cron Job Failed, May be other cron running prior to our user cron is failing
Solution to check:
Go into module.inc and in the function module_invoke_all
add this extra line:
foreach (module_implements($hook) as $module) {
$function = $module .'_'. $hook;

if ($hook == 'cron') watchdog('cron', "hit $module cron"); // add this line
You should be able to check out your watchdog log and see which module is killing cron.
You ll get additional info of which modules cron is failing.
2. Cron run exceeded the time limit and was aborted.
Solution to check:
Set max_exection_time in php.ini to 0
3. Attempting to re-run cron while it is already running.
Solution to check:
select * FROM variable WHERE name='cron_semaphore';
delete FROM variable WHERE name='cron_semaphore';
So it ll delete the cron lock which is running for long time and got stuck


No comments:

Post a Comment