Cron run exceeded the time limit and was aborted.

baronmunchowsen - February 27, 2007 - 21:15

Hi,

I'm trying to run my cron manually by visiting mysite.com/cron.php

Normally when I do this (with other drupal sites of mine), I can access cron.php and once cron is run I see I blank page (mysite.com/cron.php). I then navigate back to my site by typing the site url into my browser.

What is happening here is I am going to mysite.com/cron.php and then after a few seconds being redirected to the page within my site that I accessed it from (say I typed in 'mysite.com/cron.php' while I had mysite.com/news loaded, I would be kicked back to mysite.com/news)

When I check the logs, I get the following message:

Cron run exceeded the time limit and was aborted.

Any ideas?

Using 5.1 on a site I upgraded from 4.7.3

=-=

VM - February 27, 2007 - 21:41

how much content is trying to be indexed ?

check your indexing throttle in administer -> search settings

try reducing the number of items indexed in a single cron run.

if that doesn't suffice try increasing max_execution_time in php.ini

I am having the same problem

bugmenot11 - March 4, 2007 - 13:46

LOG:
Type cron
Date Sunday, 4 March, 2007 - 15:41
User yassin
Location http://mysite.net/cron.php
Referrer
Message Cron run exceeded the time limit and was aborted.
Severity warning
Hostname 91.153.141.155

Durpal 5.1
--

Anyone know how to fix this?

=-=

VM - March 4, 2007 - 17:30

how much content is trying to be indexed ?

check your indexing throttle in administer -> search settings

try reducing the number of items indexed in a single cron run.

if that doesn't suffice try increasing max_execution_time in php.ini

I resolved my issues by try

baronmunchowsen - March 4, 2007 - 21:51

I resolved my issues by try reducing the number of items indexed in a single cron run (as was suggested below). Don't know if this is ideal, or really 'fixes the problem', but it suits me for my low-traffic site.

Not necessarily the indexing

flanderz - November 14, 2007 - 16:43

I have had this problem several times and it ultimately was never related to the indexing. The most recent time I experienced this it turned out to be an error in my modules hook_cron code. I was trying to load a user with a null uid value. I'm too lazy to track this down in the source but I bet any type of runtime exception will generate this response. The execution time certainly had nothing to do with it in my case.

Check input filters

ablivio - November 15, 2007 - 14:24

I recently had the problems and finally discovered that I had a mis-configured input filter.

More specifically, some of my nodes had been created using the PEAR Wiki input filter. After a change of server (transfer of the site from one machine to another), the "Path of PEAR packages" setting in PEAR Wiki input filter configuration was incorrect, which led to a white page when trying to display the related nodes, and "Cron run exceeded the time limit" error when launching cron.

Same problem, it seems to be the sitemap module

jurgenhaas - November 29, 2007 - 17:03

I'm hosting 10 similar sites on different topics. Setup and configuration for all of them is just the same. They all share most of the database tables.

The largest one is causing the above issue with the cron run and I suspect it's the xml sitemap update.

This site has almost 70.000 nodes, growing by another couple of thousands a day.

All other sites do work well and they are smaller (so far) - they will grow into this problem soon as well.

I have already reduced the chunk size of the sitemaps, but that doesn't help. I have also increased the execution time in php.ini and common.inc but it doesn't help.

Any ideas?

bigger issue

liquidcms - November 30, 2007 - 10:33

I think there is a bigger issue here as is starting to be eluded to. I have a site i am just developing and i see this error about 70% of the time cron runs (once per hour). I have turned indexing to only 20 per run and this doesnt help - plus the white screen comes up in about 2-3 seconds.

so something (such as an error or something else that only seems to be hit when running cron) is causing the issue - perhaps various modules that don't do their cron correctly??

Peter Lindstrom
LiquidCMS - Content Management Solution Experts

try this to debug

liquidcms - November 30, 2007 - 11:06

to try to debug wehre cron is bailing, try this:

if you 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.

Peter Lindstrom
LiquidCMS - Content Management Solution Experts

Found it

jurgenhaas - November 30, 2007 - 14:02

It was the dba module and there was a patch available that writes database backup to the disk directly instead of collecting all in memory. I'm so glad this one is resolved now.

Great tool

pchammer - December 31, 2007 - 10:34

Great tool .
This was bugging me for a long time ,found my problem in the spam-module.

check your apache errror log first

john ackers - April 21, 2008 - 10:09

I got a timeout as well after just 2 seconds but there was a "Call to undefined function" in the apache error log. Check your error log first!

+1 to checking apache error log

fysa - May 14, 2008 - 16:27

Updated Ubuntu and switched to APC. eAccelerator was still in my php.ini and causing cron issues.

error_log had:

eAccelerator requires Zend Engine API version 220051025.
The Zend Engine API version 220060519 which is installed, is newer.
Contact eAccelerator at http://eaccelerator.net for a later version of eAccelerator.

This helped a lot!

funana - September 19, 2008 - 01:08

Thank you for that hint. Found the problem. It was the pingback module in my case.
__

< href="http://friendfeed.com/rooms/drupal">Join DRUPAL on Friendfeed!
SEO Tips For Successful Drupal Sites
Infopirate: Share Bookmarks - Make Money.

For me as well!

BarisW - April 14, 2009 - 14:37

Thanks funana,

it was the pingback for me as well that killed my cron. Will have to look how to get this module working without stopping the cron..

Hi, I tried your code with

gausarts - September 24, 2008 - 19:11

Hi, Peter
I tried your code with drupal 6, and see my logs. The repetitive warnings always ends with this:

cron 09/25/2008 - 01:50 Cron run exceeded the time limit and was aborted.
cron 09/25/2008 - 01:50 hit search cron
cron 09/25/2008 - 01:50 hit node cron
cron 09/25/2008 - 01:50 hit filter cron
cron 09/25/2008 - 01:50 hit dblog cron

When I see the details for the first, it show:

Type cron
Date Thursday, September 25, 2008 - 01:50
User Admin
Location http://.../admin/reports/status/run-cron?destination=admin%2Fbuild%2Fmod...
Referrer http://.../admin/build/modules
Message Cron run exceeded the time limit and was aborted.
Severity warning
Hostname 127.0.0.1
Operations

The rests show additional messages respectively:
Message hit search cron, hit node cron, etc

So which is the guilty? Thanks

Nevermind. The guilty goes

gausarts - September 24, 2008 - 19:25

Nevermind. The guilty goes to me:) I screwed up somehow with the input formats. In my case, Status -> Fixed. Thanks

what input forms did you screw up

jonpdx - October 10, 2008 - 03:05

What import forms did you screw up? I had the same problem as you after installing that line of code.

I gave extra allowed html

gausarts - October 16, 2008 - 01:38

I gave extra allowed html into filtered html such as <embed>, then somehow it conflicted with video filter. I didn't recall the rest, sorry. But when I removed that extra tag, and also disabled search module for a moment, the cron went smoothly.

love, light n laughter
gausarts

fantastic solution

bunset - October 2, 2009 - 12:10

it worked for me perfectly.
I can see that subscriptions mail module was killing my cron process then I disabled it and it works fine.
Thanks

This was very helpful,

jonwatson - December 14, 2008 - 14:20

This was very helpful, thanks. In my case it was the PHP_filter module that was causing cron to hang. Strangely, all I had to do was disable the filter module and re-enable it again and all way well.

Thanks

Thank you

yxf9099 - December 30, 2008 - 10:39

Brilliant

As If - March 13, 2009 - 21:04

Thanks, Peter!

-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com

Any reason why this shouldn't be in core?

snorkers - April 17, 2009 - 19:20

Had been tearing my hair out for a day on a D6 site as cron had died. Tried your core hack and found out it was the Twitter module; no problem with the module itself, it's just I found out that some network ****er has recently blocked access to twitter.com.

Anyway - I know it fills up Watchdog if left as is, but is there any reason why a variant of this little hack shouldn't be part of core? Alternatively, if some fiend in the world of Devel can add this as an option in the Developer modules, it would certainly be useful.

Thanks again @liquidcms. You've preserved my sanity for the weekend.

Plus one for this debugging code

Michael Hofmockel - May 19, 2009 - 21:33

Thanks for the debugging cron code. I found this post in 2 minutes after noticing my problem. Another 2 minutes later problem solved.

Michael Hofmockel
iMed Studios

Open Source | Open Access | Open Mind

Snippet's really helpful,

bsuttis - July 8, 2009 - 05:06

Snippet's really helpful, thanks.

node.module appears to be my issue, I assume having 15000+ nodes in a Dreamhost Private Server environment is not an ideal situation, and I've found that commenting out node.module's cron hook lets cron run and complete.

My question is, looking at node.module's cron hook, is it really that important? From the limited reading I did, all it does is loop through each node and update it's read/new/updated tag that appears on admin/content/node. Are there other issues that would occur if I left it commented out for the time being? Other than the 'new' markers not working?

Turn off cron sitemap submit

Thomas Sewell - February 2, 2008 - 05:40

On the sitemap configuration page, turn off submitting your sitemap with every cron run.

Presumably the submission process is timing out.

If you really want that feature, test the urls contained in the setting manually for submission to see if they work as expected.

set_time_limit(0);

phpsharma - September 19, 2008 - 03:44

You can do
set_time_limit(0);

on top of cron.php

so that the script will run forever - however this is not recommended and your web server might catch you out with an imposed HTTP timeout (usually around 5 minutes).

facing strange cron issue

ashish.cms - November 21, 2008 - 12:33

when I run the cron from browser like http://www.example.com/cron.php then cron runs successfully but if I sets cron from c panel cron jobs then its showing "Cron run exceeded the time limit and was aborted." error 80-90% times.
I am stuck on this problem.
I have used set_time_limit(0); at top of cron.php
reduced the number of items indexed in a single cron run to 10.
but all in vain any body have any idea about it ,why it is happening?

>>when I run the cron from

andrus_k - December 1, 2008 - 07:51

>>when I run the cron from browser like http://www.example.com/cron.php then cron runs successfully but if I sets cron from c panel cron jobs then its showing "Cron run exceeded the time limit and was aborted." error 80-90% times.

I have the same problem. Any ideas?

Another 'me too' - don't know

geerlingguy - June 4, 2009 - 23:29

Another 'me too' - don't know why this is happening. :-(

__________________
Life is like Drupal: At the end of the day, you wonder how everything's still running!

update your modules page

deekayen - December 30, 2008 - 05:17

I have experienced this when I move modules to a different location that invoke cron. I try to run cron.php and it instantly stops. Just re-save the modules page and it'll reset the saved location of the modules and cron runs again.

I am running Drupal 6 and

parrottvision - January 3, 2009 - 18:52

I am running Drupal 6 and this happens. If I disable the search module it doesn't. But I can't really live with the search module off. I haven't found a fix yet, open for ideas.

UPDATE: FIXED! After alot more searching I found the issue was with a node that I had PHP in that said "If the URL is missing a variable then redirect to homepage" (using PHP header: location) - So when cron was running through search indexing it was hitting the page and then redirecting to the home page. This is a bad piece of code and silly of me. I removed it - job done.

This node solved it for me. http://drupal.org/node/102138

PHP header: location

aymeric - February 23, 2009 - 15:05

Hi,

We solved our cron problem like you: removing a php header location in one Node. Thank you for your message! it's works fine now :-)

Cron run exceeded the time limit and was aborted (search_block).

kaptain_kyle - January 8, 2009 - 11:23

After checking watchdog it appears that I haven't completed a single cron job successfully for quite a while on my 5x installation. I've modified module.inc file show each module.

My last entry before it times out is... hit search_block cron (aka Restricted Search)

When I run cron manually it waits and eventually takes me to my Gallery page (Gallery2 with gallery.module) and throws the same exception in watchdog.

If I turn off the search_block module the cron job will complete (hooray!). Unfortunately turning this module off permanently is not really an option. Currently PHP is configured to max_execution_time of 60. What am I missing?

show each module?

mroswell - January 26, 2009 - 15:03

How did you modify module.inc to show each module? I'm having the same kinds of cron trouble (in 5.x) , and would appreciate the troubleshooting tip.

UPDATE: I see it here: http://drupal.org/node/123269#comment-644012

adding file info?

mroswell - January 26, 2009 - 16:47

Adding the module name to the log worked (API's module is where it stopped).

Does anyone know how to log a system message to add the particular offending file that causes the thing to stop? (not just the module?) I'm in Drupal 5.

Disabling the PHP filter,

webfootwander - February 26, 2009 - 02:08

Disabling the PHP filter, running cron from mysite.com/cron.php and then re-enabling the filter worked fine. Seems a bit bizarre to me. That bit of code in modules.inc really works! Thanks heaps.

re: Disabling the PHP filter,

slinberg - March 5, 2009 - 17:28

That worked for me too, in the end... disabling the PHP filter (which is dangerous for my site), re-indexing or running cron, and then turning it back on.

However, this is not a workable ongoing solution; cron needs to run without dying on the PHP filter. What needs to be done here?

WOW

mgroo - March 13, 2009 - 15:36

Great. Disabling the PHP filter did work for me as wel.. I wonder why that is. After enabling the PHP filter, CRON was still running without any problem

Similar Woes

geerlingguy - March 24, 2009 - 19:13

I'm having trouble from time to time with this... still trying to figure it out. But it often boots me to a 500.shtml page after the cron runs complete. Very odd behavior indeed.

__________________
Life is like Drupal: At the end of the day, you wonder how everything's still running!

drupal_goto

raintonr - May 17, 2009 - 10:30

Be careful of using drupal_goto in your php_filter nodes. See #453286: drupal_goto breaks cron.php

Odd...

geerlingguy - May 17, 2009 - 15:24

This is something really odd. First off, cron always hits the search module and grinds to a halt.

But that's not the weirdest thing; if my crontab entry hits cron (using the wget method), cron times out after two or three times (I have it hit every half hour). But if I manually start cron using the 'Run cron' task in Administrator Menu, cron runs without a hitch. What could be the difference there?

__________________
Life is like Drupal: At the end of the day, you wonder how everything's still running!

Search.module - patch to help in Drupal 6

geerlingguy - July 8, 2009 - 22:52

I found and applied this patch #312390: Performance: search_update_totals() slow with large number of nodes (in comment #10) to Drupal 6.13's search.module, and cron times have decreased from ~8 seconds to ~1 second, on average.

__________________
Life is like Drupal: At the end of the day, you wonder how everything's still running!

How I fixed mine

GBain22 - July 14, 2009 - 14:25

Disabled the php input filter - kind of a nightmare if you have a large sites with plenty of modules - thanks for the help anyway guys.

Garry.

Garry Bain, sdesign1
Drupal Experts

What is Watchdog log?

tinem - July 14, 2009 - 14:59

I have tried putting this code if ($hook == 'cron') watchdog('cron', "hit $module cron"); // add this line in module.inc but what next? What is Watchdog log?

I also have some node where I use php and redirect but it can't be true that you can't use php code in Drupal, right? And it has been working before but not for a week and 3 days now. When I try to opdate cron manually I get one of the note sites where php is made from an external database.

On my host I have max_execution_time 300 but that is ok, right?

I use Drupal 6.11 and the site is here http://www.tinemuller.dk/drupal/. It's only a testsite but I'm still learning and would like to have this problem solved, please.

Can noone explain what Watchdog log is and how it's functioning?

tinem - July 15, 2009 - 04:45

I have now deleted the site with the php code which I got to when running cron manually but NOW I get a message Page not found http://www.tinemuller.dk/drupal/node/721 - what does all this mean, please help?

I still have some more sites with php code from external database but will not delete them before I hear something from you.

Watchdog is Dblog

tinem - July 16, 2009 - 06:59

I found this site http://drupal.org/handbook/modules/dblog/ explaining that in 5.x and earlier Dblog was called watchdog. So for beginners who doesn't know this - watchdog is Dblog. :-)

Now in my admin menu under Reports I see:
Recent log entries
http://www.tinemuller.dk/drupal/admin/reports/dblog
http://www.tinemuller.dk/drupal/admin/reports/access-denied
http://www.tinemuller.dk/drupal/admin/reports/page-not-found
http://www.tinemuller.dk/drupal/admin/reports/search
http://www.tinemuller.dk/drupal/admin/reports/updates
http://www.tinemuller.dk/drupal/admin/reports/status

Where do I go from here? If I take a PrintScreen of some of the Reports can someone help me further or tell me where to ask for help if not here, please?

filter by "cron"

liquidcms - July 16, 2009 - 14:22

@tinem - go to http://www.tinemuller.dk/drupal/admin/reports/dblog and select filter by "cron" at the top. If "cron" isn't in the list then that means you have no cron logs; if thats the case then it means you aren't running cron, if you do have cron msgs and you added my hack above.. the last one that shows should point to the module that is dying during your cron run.

@liquidcms - thanks for

tinem - July 18, 2009 - 11:46

@liquidcms - thanks for trying to figure out what went wrong. I have now uploaded a PrintScreen http://www.tinemuller.dk/drupal/div/dblog.gif which shows what I see but can't see any module mentioned or?

search

liquidcms - July 19, 2009 - 07:31

cron dies during search.. go to admin/settings/search and reduce number of items to index during cron run.

In Addition

garyalldredge - August 15, 2009 - 23:42

You could just go to
http://yourserverip/drupal6/cron.php
when you do that it automaticly invokes cron and you can see the problem there.
Myne looks like this

Fatal error: Call to undefined function curl_init() in /usr/share/drupal6/modules/storage_api/storage_api.module on line 1244

so it looks like it is the storage api module that is giving me issues and not the time that it takes the scrypt to run

Thanks All and happy Drupaling

Outdated RSS Aggregator feed

huc - September 1, 2009 - 00:33

All of this discussion was helpful in my isolating the same problem for site. The fix however was different:

In my case I isolated the error to the Aggregator module; the cron time out error was occurring because an off site RSS feed was out of date. Deleting the outdated feed corrected the problem and cron now runs normally with Drupal 5.19

This worked for me...

zzrwood - October 26, 2009 - 05:47

I had the same problem when I moved a site from my VPS server to a shared hosting server. Cron ran fine on the VPS but not with the identical site on the shared hosting.

Eventually I found that I needed to disable the PHP filter module, run cron (which then worked), and then re-enable the module - cron then continued to work.

Hope this might help someone else - took me a fair bit of trial and error to get it fixed.

Cheers

Robert in Oz

Cron is really busy, even if

As If - October 26, 2009 - 18:08

Cron is really busy, even if items to be indexed is low, there are still lots of other things cron does (could be quite a lot, depending on which contrib modules you have installed). I have been experimenting with replacements for cron allowing better control of these individual tasks. The Supercron module is good. The Elysia Cron module is even better IMHO, but it is a little trickier to set up (you need to understand the syntax of a crontab). With these modules you can break up the various cron-driven tasks and have them run at different intervals.

-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com

 
 

Drupal is a registered trademark of Dries Buytaert.