Drupal 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).

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.'

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.

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