Cron failed to run

blavish - May 12, 2007 - 18:04

Cron failed to run, and i have no idea why. My site depends on cron working. I am not that technical. Any ideas? please help.

=-=

VeryMisunderstood - May 12, 2007 - 18:05

will it run manually ? yoursite.com/cron.php ?

No it wont

blavish - May 12, 2007 - 18:08

Even when i am logged in. and i run it, doesnt work.

Any help will be great. Thanks.

What is the error?

mikey_p - May 12, 2007 - 19:10

When you load cron.php is there an error reported? or are you seeing an error in the logs at admin/logs/watchdog ?

When you load cron.php in a browser the standard result is a blank page.

-Mkey P

Yes there is this error -

blavish - May 12, 2007 - 19:16

Cron has been running for more than an hour and is most likely stuck.

And when i run /cron.php there is a blank page.
Do you know how to fix this?

Thank you for the help

=-=

VeryMisunderstood - May 12, 2007 - 19:18

running cron manually will produce a blank page. theres no output. after you run it manually, does your status log says its complete ?

No it says:

blavish - May 12, 2007 - 19:37

Attempting to re-run cron while it is already running

Any ideas what i can do?

Thanks

=-=

VeryMisunderstood - May 12, 2007 - 19:38

remove your cron job from your host. try to run cron manually. if that doesnt work your host may need to be informed.

Please tell me how to do that.

blavish - May 12, 2007 - 19:59

'remove your cron job from your host. try to run cron manually.'

Thank you again for the help.

Cron not working

jasio - May 12, 2007 - 21:10

Hi,

As someone pointed out, cron.php does produce an empty page.

1. What does your status page (http://your.site/?q=admin/logs/status) say about cron? Mine, for example, says:

Cron maintenance tasks Last run 4 min 24 sec ago
   You can run cron manually.

2. Run cron manually - you can open http://your.site/crone.php from your browser, or better click a link in the status report. Did the status report change? Mine did:

Cron maintenance tasks Last run 4 sec ago
   You can run cron manually.

3. If you complain that your cron does not work any more, I suppose, that it did - so you must have had to configure it somehow. You can execute cron.php directly (well... almost... you need a console web browser or wget) from a machine the system is on, remotely from another machine you have a shell access (in case of unix/linux, or a similar level of access in case of Windows), one of cron services in the Internet (for example, I use a cron service provided by my ISP), or a poormanscron module - depending on your access rights, available services etc. You have not written, which way you execute your cron.php, so it's rather difficult to advise, how to turn it off and diagnose. In general, turning cron off is quite similar, to turning it on. :)

4. You were not specific. How do you recognised that cron had not worked? Was it something in a status report or drupal admin page, or you noticed, that some of tasks cron was supposed to do had not been done?

--
Best regards,

(js).

=-=

VeryMisunderstood - May 12, 2007 - 21:47

Your hosts documentation should provide for you the information specific to their/your server on setting up cron jobs on the server. you would point the cronjob to yoursite.com/cron.php and it would run automatically without using yet another module like poormans cron.

Thank you all, i got it working.

blavish - May 15, 2007 - 09:05

What i did was i ran cron from the hosting company in cpanel
that saw that it crashed and reset it. so i installed poormanscron and made it to run every 10 minutes.
That fixed it.

Thanks for all the help.

Delete the Cron variables

NancyDru - June 21, 2007 - 16:11

You need to delete the variable 'cron_semaphore' from your variables table. You can do this with phpMyAdmin, the Devel module, or the Site Documentation module.

Cron will not run again until this is done or the long running job completes (which is unlikely after an hour).

If you have Update_Status on this site, I suggest you disable it - this is the primary culprit I have seen for stalled Cron jobs. IMHO it should not be used on a production site any way.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

Reasons for dead Cron jobs

asbdpl - July 26, 2007 - 13:41

> If you have Update_Status on this site, I suggest you disable it - this is the primary culprit I have seen for stalled Cron jobs.

There are lots of other modules causing Cron to hang, e.g. "Amazonitems" which tries to update it's data through Amazon's REST API. You can configure Cron to send reports about deadlocks and errors. If you do, you'll get messages like:

Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 4104 bytes) in /var/www/drupal/modules/amazontools/amazon.module on line 506

Another potential candidate is "db_maintenance" which compacts database tables on a regular basis; this module is smart enough to let the user choose, how often (daily/weeky/monthly) and which tables have to be "optimized". If you have a mid-sized Drupal site and set it to "daily" optimize the complete database, it is very probable that Cron will fail.

Another module might be "Search" from Druapl Core, where at least the number of nodes to be indexed can be configured (10-500). Depending on the hardware, especially on slow machines with limited amount of RAM, I found it necessary to set this as low as possible (10 nodes/Cron run). Also, it might be advisable to look for alternatives like SQL Search/Trip Search or even to utilize Google search.

Lots of modules rely on Cron, few of them can be throttled in a reasonable way - "Indexing status: 0% of the site indexed. 20788 nodes to go"...

Regards, -asb

howto

Oceria - November 2, 2007 - 07:19

(...)You can configure Cron to send reports about deadlocks and errors.(...)

After setting search indexing to 10 a time, settings pathauto to 25 (default 50, but I had it set to 100 to manually bulk update and then forgot to put it back to 50) and setting xml.site (aka gsitemap) chunksize to 10,000 rather than 50,000, my cronjob does not fail anymore, even with the update status running. Mind you: it is set to check once a week, so it cannot hogg every cronjob...

However, I am curious about the cronjob configuration. I have searched drupal.org for "configure+cron.php+report+error", but did not find a way to configure cronjobs in a way you describe. Could you tell us where to find that info, or how it is done?

Oceria doesn't know where this -repeatbutton -repeatbutton is....

Thanks a lot you solved my

executex - May 16, 2008 - 01:57

Thanks a lot you solved my problem.

1) After deleting semaphore in Variable table....
2) Set XML Sitemap module chunk size to 10,000.
3) Set Search Settings to "10 per cron"
4) Set PathAuto General settings from 50 to 25 for objects to alias.
5) Ran Cron, it stopped failing...
This has been bugging me for months. Thanks.
-
Computer Engineer from Virginia Tech

After deleting

adminfor@inforo... - October 4, 2007 - 22:23

After deleting cron_semaphore, still no running. Also rebooting the server and no solution.
I also changed cron_last as node_cron_last +1 and cron.php released OK
Cheers!
Gustavo

After deleting

openam - April 18, 2008 - 04:06

I tried deleting cron_semaphore, and cron.php still would not run. It did however work once I dissabled the Update Status module.

Thanks for the tip.

My error seems to only say

executex - January 18, 2008 - 03:31

My error seems to only say "Cron failed to run" after clicking "run cron manually".
Also the first time I did this it said "Server internal error 500" or maybe it was 503.
In the watchdog logs it says "tried to run cron while Cron is already running"
It doesn't make any sense to me, my last cron is still 24 weeks ago, and I did try using cron.php... I don't know what happened (I use 1and1.com hosting).
I tried poormanscron but it seems to give an internal error 503 or 500 when confirming installation.

I don't understand how cron works, and there doesn't seem to be any options to play with in settings.
-
Computer Engineer from Virginia Tech

Manually

NancyDru - January 18, 2008 - 04:27

Can you go to your status report and run it manually? 24 weeks is an awful long time between runs.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

That's where the Run Cron

executex - January 19, 2008 - 01:59

That's where the Run Cron Manually click is at... I tried that, it refuses to run. Seems to happen in many of my Drupal installations. I simply assumed Cron was just never tested enough to work on any site. Perhaps because of the server i use.
-
Computer Engineer from Virginia Tech

What errors

NancyDru - January 19, 2008 - 02:23

What errors are you getting? Cron runs fine on tens of thousands of Drupal sites.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

Running Cron manually for

executex - January 20, 2008 - 04:33

Running Cron manually for first time: "Server internal error 500"
After Running Cron and going to Status Report: "Cron failed to run"
Watchdog: "tried to run cron while Cron is already running"

Apparently it doesn't work on 1and1 servers... Or magically my sites.
MySQL database 4.0.27
PHP 4.4.7
Web server Apache/1.3.33 (Unix)
-
Computer Engineer from Virginia Tech

Start by removing the variables

NancyDru - January 20, 2008 - 15:22

Start by removing the variables mentioned above. When you manually invoke the Drupal Cron function, there is nothing that should not work.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

I have one site, its a plain

executex - January 20, 2008 - 21:33

I have one site, its a plain old drupal site, with just a lot of modules similar to my other site, that doesn't have much of anything, and that is working fine. It crons normally. Nothing fails. It's the other site with clean urls and htaccess edit that seems to fail everytime and get internal server errors when running cron.
Logs say:
Message Cron has been running for more than an hour and is most likely stuck.
Severity error

This I suppose has been like this for 24 weeks according to status report.
-
Computer Engineer from Virginia Tech

And it will stay that way until

NancyDru - January 20, 2008 - 22:47

And it will stay that way until you delete "cron-semaphore." Until you do that, Cron will not run again. Until you do that, there is no point in posting any more error messages. This may have been left set for any number of reasons and it is probably too late to know now.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

I dont know what you're

executex - January 25, 2008 - 01:16

I dont know what you're talking about:
This is my variable table that has the word "cron" in it:

node_cron_views_scale d:0.0018975332068311194788634566066320985555648803...
Edit Delete cron_last i:1185924138;
Edit Delete node_cron_last s:10:"1177429673";
Edit Delete node_cron_last_nid s:1:"3";
Edit Delete xmlsitemap_cron_submit i:0;
Edit Delete search_cron_limit s:3:"100";
Edit Delete privatemsg_last_cron i:1200803514;
Edit Delete node_cron_comments_scale d:0.2;
Edit Delete poormanscron_lastrun i:4200;
-
Computer Engineer from Virginia Tech

I've been experiencing a

Mojah - June 19, 2007 - 22:31

I've been experiencing a similar issue on a production site. In order to get the search index module to run, I have to go into the variables table and delete the entries for cron_semaphore and cron_last, else I get this message...
Cron has been running for more than an hour and is most...
I also get these messages in watchdog...
Attempting to re-run cron while it is already running.
mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/heaven/domains/heavenletters.org/public_html/includes/database.mysql.inc on line 218.

I run cron from command line and it usually works after deleting the entries from the variables table. php timeout has been extended on the vps account the site runs on. I disabled modules likely to affect cron, like schedule and subscriptions (which does have a list of bugs), yet still cron seems to get stuck when I setup a cronjob. This particular site has nodes on schedule which get published at around 2am everymorning, so that people closer to the land of the rising sun can receive their content first thing in the morning.

<aside>I have a cronjob that calls a Drupal node which outputs the latest published cck node type to a text file, which is then distributed via our newsletter management software</aside>

I don't mind publishing manually at 2am, but it would be more efficient if it was aut0mated ;)

Suggestions anyone?

Same here, I have Drupal

emaylx - June 20, 2007 - 16:34

Same here, I have Drupal powered websites on 3 different VPS servers, and all websites running similar modules but under MySQL 5.0.41 & PHP 5.2.2 & RH9 works fine, no problems with cron, however one new website using MySQL 5.0.37 & PHP 5.2.3 & CentOS has now exactly the same problem as reported: "Cron run failed" and watchdog says: "Attempting to re-run cron while it is already running."

Interesting! I'm on Centos

Mojah - June 20, 2007 - 23:20

Interesting! I'm on Centos VPS accounts with mysql 4.1.11 and php 4.4.2. Could this really be something to do with php and Centos. I wonder if anyone else is experiencing the same.

Bump bump, anybody ;) The

Mojah - June 21, 2007 - 16:02

Bump bump, anybody ;)

The only thing that works for me now is deleting from variables table and running cron from command line. Poormans cron does the job partially but I require cron to be run at a specific time.

I noticed several mysql errors mysql_num_rows(): supplied argument is not a valid MySQL and duplicate entries errors for the search_update_totals query.

As said a lot of modules are

Oceria - November 8, 2007 - 15:54

As said a lot of modules are cron hoggers. Do you have a forum embedded other than the standard forum? That was the culprit for me.

Other tips that help:

  • Set cronjob to run ever 15 minutes, or even more often
  • Set search index to minimum (10)
  • Set xml sitemap to chunks of 1,000 (instead of 50,000)
  • Go over all other modules and set them to the lowest workload possible

Now after checking all that, run cron manually, untill in search everything is indexed, all url's have been converted to clean url's and all comments that should be closed are closed. This might mean you need to run cron quite a few times! If all is well your cronjob should not time out anymore. If it still does, set php to max_exec_time for 240 seconds and max_input_time for 240 seconds as well. Also set your php max memory to 16 or 32 MB (depending on the rules of your host) to give cron more time and memory to run. If cron still runs out of time, reduce the time between cronjobs even lower. Running cron takes up time and CPU power, so don't go lower than 10, maybe 5 minutes. If it still times out, review your modules. Which ones do you realy need? Disable the ones you dont realy need and check again.

Oceria doesn't know where this -repeatbutton -repeatbutton is....

Centos here

TC44 - May 18, 2008 - 18:51

Same problem, php 5.

Cron started failing, none of the above suggestions work, although deleting cron_semaphore did work initially, but not anymore.

One last thing to try

delmont - October 18, 2007 - 19:21

I tried all of the above, and even went so far as to delete every row in the variable table that even had the word "cron" in it, but nothing helped. The only way I finally got cron to run was to delete the search index at admin/settings/search, and start over from scratch. As soon as I deleted the index, I tried to run cron manually from admin/settings/status and it worked immediately.

....

Sree - November 2, 2007 - 07:27

yes....

"delete the search index" - this was also the same thing which i followed to solve my cron rel issues ....

I installed poormans cron

blavish - November 11, 2007 - 07:36

And it fixed it for some reason.

Less Throttle

creativepragmatic - January 26, 2008 - 21:39

After attempting all of the above, I solved this problem by reducing the 'Index Throtte' to a level my server could handle. I realized that my server doesn't have the resources to handle 100 items at one time.

Cron Fails After Upgrade to Drupal 6.1

techgy - April 2, 2008 - 19:30

I've noticed a lot of request for help with Cron issues and perhaps someone could offer a suggestion on a problem I'm having. I recently upgraded a Drupal 5.x site to Drupal 6.1

Everything is working fine except the Cron.php file fails with an error message that says;

"Table xxxxxxx.websites.test" not found (or words to that effect).

To my knowledge I've never had a table named "websites.test". I DO have an MYSQL db named "websites".
My problem is that I have no idea as to where to look for the error. I've search the cron.php file and other file native to the Drupal 6.1 installation to no avail.

Suggestions welcome. Where is this error coming from? How do I clear it so cron will run?

Not Cron

NancyDru - April 2, 2008 - 22:23

Cron itself is pretty dumb and does very little. There are many modules that implement hook_cron. It is one of those modules that is producing the message.

Create a php format page to see who it might be:

<?php
 
echo theme('item_list', module_implements('cron'));
?>

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

I traced the error down to

techgy - April 4, 2008 - 01:40

I traced the error down to the Search module, which is a part of the Drupal 6.1 core.
If the search module is disabled the error goes away. I suspect that the problem is with the search index, but I have no idea as to where the index is or how to clear it.

For the time being, the error is gone and I don't really need the search module - in fact it never worked properly anyway, so leaving it off resolves the issue. I would like to know where the search index is just for reference.

Anyone got any ideas?

Table

NancyDru - April 4, 2008 - 03:11

Search builds several tables in the database - one of them is the index. The easiest way to clear it is to click the rebuild button.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

same problem here. i

yngens - June 16, 2008 - 22:08

same problem here. i reinstalled search module, set Number of items to index per cron run in search module to 10 items, cleared sron_semaphore variable, and successfully run cron but for just ONCE. trying to manually run cron fails again.

Cron has never run. I have ver 6.1 installed.

dbkguy - April 9, 2008 - 17:58

I have the default cron files installed. I never changed them. Cron.php is configured to run twice a day and this is the error report I get in e-mail twice a day. In the status page says you can run manually, but it points to a admin/reports directory which doesn't exist.
I have run cron.php from my firebox browser and I can a white page result, but status still says it never ran.

Any ideas what's wrong. I use GoDaddy.com

Here is my e-mail error report.

/var/chroot/home/content/d/b/k/dbkguy/html/cron.php: line 1: ?php: No such file or directory
/var/chroot/home/content/d/b/k/dbkguy/html/cron.php: line 2: //: is a directory
/var/chroot/home/content/d/b/k/dbkguy/html/cron.php: line 4: /Packages: Permission denied
/var/chroot/home/content/d/b/k/dbkguy/html/cron.php: line 5: backup: command not found
/var/chroot/home/content/d/b/k/dbkguy/html/cron.php: line 6: syntax error near unexpected token `('
/var/chroot/home/content/d/b/k/dbkguy/html/cron.php: line 6: ` * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).'

I just checked my logs and it says Cron has been running for more than an hour and is most likely stuck.

I called GoDaddy and they said cron was not running. I also deleted the cron job and retried it, same thing. Whats up with cron?

Fixed mine

TC44 - May 18, 2008 - 23:28

In my case it was the auto-expire module that cron was hanging on.

I edited the module.inc file as per this thread: http://drupal.org/node/43075 and checked the logs to see where cron stopped.

Maybe that will help someone else.

I removed the "pingback"

davebv - May 24, 2008 - 16:26

I removed the "pingback" module, because I saw mysql errors naming that module, now cron run OK.

Fixed an error where cron failed to access cron.php

Unity - May 31, 2008 - 15:18

Cron has always worked perfectly for me. After installing three modules that ended up not working, and then removing them, cron no longer ran. My host's auto-message said that it failed to access *cron.php. Attempting to run cron manually from within Drupal gave me the same error.

After checking this page, I thought to simply type the url to my cron.php file, and it ran correctly, delivering a blank page. This completely fixed the problem. Cron autoruns correctly, and when I run it manually from within Drupal. Just wanted to let people know, in case this helps anyone else.

Posts too Long

sportguy612 - June 20, 2008 - 14:22

Im kinda new at this, but after 2 days of troubleshooting, I began using the Reindex module (which is great, thanks douggreen). Basically, my theory was that there were a few bad apples (or nodes) that were spoiling the entire run. By publishing/unpublishing content and reindexing, I isolated 4 or 5 nodes that would cause the reindexing to exit in http error 500. All five nodes were remarkably long (and I mean EXTREMEEEELLLLLYYYYY long).

Deleted these nodes, the reindex module completed and cron worked.

hope this helps someone

Mina Samaan
www.copticchurch.org/drupal6

My solution

m00nc0w - July 8, 2008 - 12:53

Hey!

I see that everybody have some problems with Cron.

Now I have the same problem and I found the solution (for me) :

It was the newsletter!! I Have removed all the subscriptions and now I can run cron successfully but no newsletter. Arghhh ...

I had the same problems I tried everything (cron_semaphore and all those methods) but nothing worked only this.

I post cause maybe somebody will just go insane like I did and maybe this will help him.

If somebody know how could I fix my problem please drop a reply or a PM. It would be just great!

~Thanks~

Post an issue

NancyDru - July 8, 2008 - 15:04

Any time a module causes problems, you need to post an issue against that module. Most likely, the maintainer is going to have to add a feature to segment the subscriptions to send fewer out at one time. Or you can increase the "maximum execution time" if your host allows it.

NancyDru (formerly Nancy W. until I got married to Drupal)

 
 

Drupal is a registered trademark of Dries Buytaert.