Making technology work for you...

Get Your Free Subscription By Email:

Diagnosing And Fixing Drupal Cron Job Errors

Drupal IconDrupal is an excellent open-source CMS but at the same time a bit harder to get hold off when things get bad without fairly advanced Drupal knowledge, recently I upgraded this blog from Drupal 5 to Drupal 6 and after making the site live with upgrade the Drupal cron-job started failing as evident in the picture below (the cron is setupped to run every six hours but it failed to do so).

Failed Cron Job In Drupal

Strangely enough running cron manually showed a 404, Page Not Found error, having tried everything from fixing cron commands to playing with cron.php file-permissions finally I found the reason of failed cron-jobs by having look at 'Drupal Log' which was showing error 'Cron run exceeded the time limit and was aborted.'

Cron Job Timing Out

Now, the question was how to know why the cron was timing out - the problem here is that Drupal not only takes care of it's own jobs like pinging, search-indexing, maintenance etc. during each cron-run but also allows modules to implement cron-hooks, so knowing the exact culprit was essential to debug and fix the problem. Thankfully, Drupal does have a module SuperCron which allows users to see what cron-hooks are in-place, how much time each cron-hook takes to execute, capture any output generated by the hooks, identify the exceptions raised by individual hooks and even invoke and disable individual hooks.

Diagnosing And Fixing Drupal Cron Jobs Using SuperCron

After, installing SuperCron I was able to pin-point the erroneous cron-hook which was Ping in my case, disabling the ping module cron-hook worked and later I hunted down the problem to be Ping unable to reach remote server due to firewall restrictions, allowing which in firewall made me re-enable it without any issues.

Add new comment

This is just one of the many helpful tips we have posted, You can find more stories here,
Do subscribe to updates using your favorite RSS feed reader or using the secure FeedBurner email update form on top of this post.