Cron run exceeded the time limit and was aborted.
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

=-=
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
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?
=-=
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
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
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
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
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
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
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
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
Great tool .
This was bugging me for a long time ,found my problem in the spam-module.
check your apache errror log first
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
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!
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!
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..
Baris Wanschers (@BarisW)
Front-end Drupal developer
Hi, I tried your code with
Hi, Peter
I tried your code with drupal 6, and see my logs. The repetitive warnings always ends with this:
When I see the details for the first, it show:
The rests show additional messages respectively:
Message hit search cron, hit node cron, etc
So which is the guilty? Thanks
Nevermind. The guilty goes
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
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
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
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,
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
My website
http://www.yearinsurance.com/
Brilliant
Thanks, Peter!
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Any reason why this shouldn't be in core?
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
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,
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
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);
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
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
>>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
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
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
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
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).
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?
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?
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,
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,
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
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
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
Be careful of using drupal_goto in your php_filter nodes. See #453286: drupal_goto breaks cron.php
Odd...
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
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
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?
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?
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
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"
@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.
Peter Lindstrom
LiquidCMS - Content Management Solution Experts
@liquidcms - thanks for
@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
cron dies during search.. go to admin/settings/search and reduce number of items to index during cron run.
Peter Lindstrom
LiquidCMS - Content Management Solution Experts
In Addition
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
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...
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
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