After updating to Drupal 6.10 from Drupal 6.4, always getting "cron run failed" message.
I checked with my webhosting provider and they said everything OK, ask support from Drupal.org

Regards,
-S-

Comments

austintnacious’s picture

I have that happen quite often!

I probably have too many modules installed and enabled but what the. . .

I can't remember where I picked this up but I'll pass it along. . .

Sometimes when your cron run fails if you go into your Drupal database's "variables" table and delete the "cron semaphore" and "cron last run" entries and then try running cron again.

It seems to work for me about 80% of the time.

Good luck!

snorkers’s picture

I can't find a variable called cron semaphore anywhere in my MySQL database. Cleared cron_last_run, but didn't bring back cron at all :-(

Anonymous’s picture

This may be a duplicate of #361171: How to debug cron stoppage problems with bad PHP content. I have the same issue of cron.php not executing on one site I upgraded from 5.3. The problem is that some modules hook_cron implementation fails but we have no idea which module because cron.php registers a shutdown function and that function doesn't report module failures making the message from the cron run totally meaningless. Later.

snorkers’s picture

Thanks for the suggestion @earnie, but proved a fruitless effort

I disabled Search: cron still does not run
So I also turned off Porter-Stemmer (improved search module): no change
Thinking it may be related to Path, I also turned off Path, Pathauto and Global Redirect: no change

What's even more worrying is that when I run /cron.php directly, it now bails out after a mere 3-400ms with all those modules disabled. The PHP script limit [on my dev machine] is currently set to a whopping 240s. Which leads me to think that the cron problem is not related at all to Path and Search -type functionality.

Mmmm...

sunilkumar’s picture

I tried after disabling search module( an many other modules like aggregator), no result. But I want to check that Drupal database variable deletion. Till now I am not able to do that because of my network connection problem. Shall write the result here tomorrow or day after.

Regards,
-S-

sunilkumar’s picture

I did as "austintnacious" instructed. But still the message is "cron run failed". At the same time admin/reports/status it shows against Cron maintenance tasks: "Last run 6 sec ago". Does this means cron was OK, but the message is incorrect?

I am not getting any idea!

Regards,
-S-

UPDATE: I tried to run cron again after some time. But not successful. That means the message is correct. How to solve this?

Anonymous’s picture

Category: support » bug
Priority: Normal » Critical

Based on my debugging via adding messages to watchdog. My cron.php is dying returning the $node object from node_build_content. The $node object never appears to the calling function.

The node is rendered to the browser instead. The results I see at least make some sense now.

Anonymous’s picture

Title: Cron Run Failed » Cron Run Failed - Node object rendered to browser instead of returned to _node_index_node
Anonymous’s picture

Hmm... I was able to deactivate search and execute cron on my site. Reactivating the search module returned the previous result. I do know the problem is deeply rooted into Drupal or even PHP. The result is the page being worked on by the search_cron implementation ends up displayed instead of indexed. The status of % indexed seems to be invalid on the settings page as well. It reports zero but I know there is already data in the file.

dave reid’s picture

Another module that kills cron: pingback. Disable that one too if you have it enabled.
#271704: Infinite Cron

Anonymous’s picture

Issue tags: +cron trouble
gdip’s picture

I recently upgraded from Drupal5 to Drupal6.
My system consists of
Apache/2.0.63 (FreeBSD 7.0 )
PHP/5.2.10 with Suhosin-Patch mod_ssl/2.0.63 OpenSSL/0.9.8e
MySQL version: 5.1.35
eAccelerator: 0.9.5.3

I had the same problem as described here and have done the following ...

  1. Searching the Drupal site and also the webb in general for clues.
  2. Checking my Drupal logs.
  3. Checking my Apache error logs (running 6 sites but only 2(!) of them had this problem).
  4. Checking my php-error log (you have to set it up/turn it on specifically in php.ini).
  5. Checking my MySQL error log
  6. Search for nodes with php code.
    See http://drupal.org/node/361171
  7. Checking the php-code in all blocks.
  8. Checking/optimizing my Drupal tables in phpmyadmin.
  9. Manually emptying the 4 search tables: search_dataset, search_index, search_node_links and search_total.
    (for some reason this is not possible from within Drupal Search settings)
  10. Rebulding the index which resulted in exaktly the same error again.
  11. Found this info
    http://www.mojahmedia.net/drupal-cron-run-failed-cron-busy-probably-stuc...
    to release a stuck cron.
  12. Made cvs backup of the node_revisions table to my Desktop computer and searched it for php code.

Very few findings
Apache error log complained about a call to the (nonpresent!) tablemanager in one site.
Searched all nodes and blocks for php code but couldn't find anything special. Somewhere on this Drupal site someone mentions that a MySQL command has changed and has to replaced when upgrading to Drupal6. Couldn't find it again :-(

How I solved it (maybe?)
In one of the small sites which gave the table manager error, I installed it and that solved the problem for that site. Of course I deinstalled it prior to upgrading but for some reason the search indexer thought it was enabled. Since my programming skills are limited I have no clue to why this can happen.

I deinstalled eAccelerator (found a note about incompatibilities between it and the Zend engine). No difference. Reinstalled it.

I installed supercron, http://drupal.org/project/supercron, and turned off search to make sure none of the other cron hooks gave me a problem. I also turned off indexing of all content types except for one and ran cron, turn on another content type and ran cron etc.

I emptied the tables above (9.).

This morning I thought that if some content with php screws up the indexing, why not turn the php filter off (and back on afterwards)?
I put the site in maintenance mode, emptied the tables above, made sure cron would start, turned off the php filter and started running cron.

Voila! It worked like a charm!

Some final notes
1. The above looks much more structured than the process in reality was. It took me close to 12 hrs to fix it.
2. The problem remains because I haven't found the bad content. Since I'm not going to reindex the site from scratch I don't think it will cause any problems (fingers crossed!).
3. Be careful when turning off the php filter. You might expose sensitive content to the public and don't forget to turn it back on! I don't have any sensitive php:ed content but you might.
4. The basic problem (at least in this case) is that I couldn't find the php code (is it?) which stopped indexing. Displaying the node id and maybe a couple of node ids before and after could be very useful when problem solving this issue.

Anonymous’s picture

It did helped me deleting cron_last

many thanx

sunilkumar’s picture

I have now three issues.

1) Started with Cron failiure

2) Cron still not running and admin pages are not accessible.

3) Database size is getting bigger and bigger. Then I empty cache tables manualy by myphpadmin.

It is drupal 6.13

Is all related issues?
Being a beginner, non techie, it is very difficult. :)

Regards,
-S-

michal-3D’s picture

It is very probably related.

I have very similar problem - we have many nodes written in php, nodes inserted in other nodes. Cron keeps failing because on function is not declare, other is redeclared, etc. - things that cannot happen on the production site (using $_SESSION, .etc). Yes, it is a real trouble I even do not know, which nodes are causing it (Drupal does not say).

But I would like to run the cron (as it is so important in Drupal), but it does not make sense to unpublish all the nodes, run it, and publish them again, or does it?

Is there any way to run the cron without running it through the nodes? (only its clearing functions, etc.)

gdip’s picture

Maybe supercron could be helpful
http://drupal.org/project/supercron

Anonymous’s picture

@gdip: Does the supercron module fix the bug? Yes, looking at the project write up of the module functions it should indeed be a useful module but I still don't see that it resolves the issue.

sunilkumar’s picture

Seems to me that this command "wget http://www.kathakali.info/cron.php > /dev/null" is working!!!

http://drupal.org/node/84472

http://tczap.com/content/setup_drupal_cron_task

Regards,
-S-

mcrittenden’s picture

Version: 6.10 » 6.16

I'm having this problem with 6.16. Anybody else still having trouble? Any workarounds I've found haven't helped.

Anonymous’s picture

@mcrittenden: The [361171] issue may be related to this one. I suggest installing Elysia Cron to help with the issue. I ended up disabling the PHP filter module.

dpearcefl’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Is this issue still occurring in the current version of Drupal v6?

dpearcefl’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active
aaronbauman’s picture

Category: bug » support

This is almost certainly an issue with a contrib module or user error in a php-filtered input.
Setting to support request until this can be reliably reproduced.

liliplanet’s picture

Version: 6.16 » 7.9

Would be tremendous if someone perhaps has the solution to finding bad php content in D7 .. as above is for D6 ..

My upgrade from D6 somehow brought along stuff that should not be there.

Have several errors on cron run:

Notice: Trying to get property of non-object in _node_index_node() (line 2632 of /home/public_html/modules/node/node.module).

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7405 of /home/public_html/includes/common.inc).

Notice: Undefined property: stdClass::$type in _node_extract_type() (line 370 of /home/public_html/modules/node/node.module).

UPDATE: So far my solution for finding bad content at http://drupal.org/node/1329872#comment-5198690 works :)

cweagans’s picture

Priority: Major » Normal

Support requests are never major or critical.

pasqualle’s picture

Status: Active » Closed (fixed)

problem: Search module and PHP code (like drupal_goto()) in nodes
solution: Disable the PHP filter module. The module was introduced for one reason only, to be disabled.