I'm running Drupal 4.6 with CivicSpace 0.8.0.6 on a linux ISP that uses MySQL.

My cron job has stopped completing. It does some of the aggregation, and then stops. This is bad, because then Drupal never gets to index the site, and as a result only 2/3 of the site is now indexed (www.correntewire.com).

Working with my ISP, I've altered cron.php as follows:

// If not in 'safe mode', increase the maximum execution time:
// if (!ini_get('safe_mode')) {
set_time_limit(1800);
// }

And 1800 is a very high value!

I have gone through my feeds and removed the ones that did not complete at some point today, or had bad data, but the cron job still gives me the "Last cron run did not complete." and still does not index the site.

Here is the cron line:

mywget -O /dev/null http://www.correntewire.com/cron.php > /dev/null 2>&1

Any suggestions?

I'm running Drupal 4.6 with CivicSpace 0.8.0.6.

Comments

nathandigriz’s picture

I have noticed something really crazy about the aggregator and cron. If I have a lot of feeds and a lot of new comments then I know things will never complete the first time. The cron starts the feed updates and also pings. I then get flooded from the ping bots and as a result the cron cannot get into the site using Lynx. The site is busy. This makes the aggregator updates stop at intervals.

I saw some one say they have 300 feeds. Iam sure they all do not update regularly even if you stagger the cron. Which does help by the way.

lambert-1’s picture

What do you mean?

I have well under 50 feeds, so it's not that.

mo6’s picture

Had the same problem here (4.6), after adding some content with images the cron job failed. Took me some days to notice, had me puzzled. I've disabled some modules (Adsense, Ping) [no, I don't use the aggregator] and suddenly cron functions again. Any ideas anyone? Gives me an uneasy feeling.

tonkeht33’s picture

Same problem. Disabled ping and works again.

nathandigriz’s picture

Are you sure that the cron is not complete? It may be a message that comes from only part of it not being complete like the fsockopen to a site times out. So only that part is not complete. I have noticed this when pingomatic is having problems.

mwheinz’s picture

I only have 3 feeds and the hourly run fails 4-5 times per day, and succeeds the other times.

I know it's cron, because the hosting company is sending me an email saying "cron killed".

When I run it by hand, usually it works (in ~5 seconds or so) and occasionally it dies with the message "premature end of script headers".

Ashraf Amayreh’s picture

In general, this happens when a critical error occurs inside a hook_cron call, a die() is a good example.

The flow won't reach all following cron hook calls and you'll get the problem you've described. The key is to find out which hook_cron is causing the crash, you can do that by adding this in the module_invoke_all() located in includes/module.inc

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

replace it with something like this :

  foreach (module_implements($hook) as $module) {
    if ($hook == 'cron')
    	watchdog('cron_runs', $module);
    $function = $module .'_'. $hook;

You'll get a new category in the event log called "cron_runs" on your next cron that will list the cron call order. The last one in this list is your culprit. Remember that this is considered core hacking and you should remove the code as soon as you discover the problem location. Core hacking is calling for trouble.

If anyone knows of any other way to achieve this without hacking the core (even if it's a temporary hack) then please let me know.

--
CEO | O-Minds
Skype. aamayreh
o-minds.com

Connect with us on Twitter or LinkedIn.

mwheinz’s picture

Hopefully that will let me know where the problem is.

afagioli’s picture

very useful!

in case case, notify 4.7 was the killer

thanks

ardee-1’s picture

Very good tip! Thanks! (Of course, now I can't get my cron job to fail like it was before...)

--
My first Drupal site: www.fuhnee.com

alex_b’s picture

Very useful tip, thanks.

Some additional observations:

* "Last cron not repeated" messages are created when cron starts and it finds that another cron is still running. This message is a little misleading because it can make you belief that cron times out but actually there is more than one cron.php being processed at once.
* wget can call cron up to 20 times in a row when cron does not return a page: http://drupal.org/node/150972
* In .htaccess I limit the access to cron.php to the IP that it is called from. On some of our sites calling cron.php could cause troubles if being called in rapid succession from a malicious user or by crawlers.

<Files "cron.php">
Order deny,allow
Allow from xxx.xxx.xxx.xxx
Deny from all
</Files>

former username: lx_barth

wwwoliondorcom’s picture

Filter module problem, what to do next ?

Hi,

Thanks to you I've found that the culprit module is FILTER, but then as I can't disable it what should I do next ?

(I can't disable it because it's a required module)

Thanks a lot.