Steps to reproduce:
1. Create a node with a PHP snippet in it; write a piece of invalid PHP code. Make sure you get a common eval()'d error.
Fatal error: Call to undefined function now() in /home/radiofon/public_html/drupal-6.14/includes/common.inc(1685) : eval()'d code on line 2
Don't fixe the error (say you're busy, the node doesn't appear on any public list so for the moment you don't care)
2. Enable search module
3. Request re-indexing of the website through the search module settings
4. Run cron.php many times.
Expected result:
With few runs of cron.php, all nodes should be re-indexed
Unfortunate result:
When it is time for the node containing a bad PHP to be indexed
(a) cron fails, and displays the exact message of the eval()'d error, same as the on in the bad PHP you wrote in step 1.
(b) watchdog reports cron has timed out (well not precisely, maybe has timed out after having failed)
(c) no following steps in cron have managed to finish.
(d) indexing has failed
I got this error after enabling Search module in my newly upgraded Drupal site. The page causing the problem had been written years ago, left aside and I had totally forgot about it.
error was discovered after adding
watchdog('search', "Indexing node $node->nid");
at line 1801 of node.module
Proposed solution: during indexing, ignore PHP errors
Comments
Comment #1
jhodgdonI believe this is a duplicate. See #361171: How to debug cron stoppage problems with bad PHP content.
Comment #2
jhodgdonThat issue 361171 was turned into a support request to discuss how to debug sites with this problem. This new issue is now where to discuss fixing search module so it doesn't crash in cron:
#752184: Keep running cron when bad PHP content is encountered
Comment #3
mariusilie commentedsubscribing. found the same error in drupal 6.20
Comment #4
jhodgdonmariusilie - this issue is closed. Please see comments above to find out where to join the active discussion.