1 item never indexes

Dinis - May 15, 2009 - 15:16

Hi all,

We're close to putting Drupal 6 into production and down to the final few bugs after migration from 5 but there is one annoying one which we cannot shift.

Every time the search index is checked, there is always 1 item left to index, there is also an error in watchdog each time the cron runs (Invalid argument supplied for foreach() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\taxonomy\taxonomy.module on line 1189.)

Is there anyway to view the content *not* indexed so that we can find out what's wrong with it?

I suspect that it is an orphaned content missing a term or CCK type perhaps, but I'm stumped to see the problem.

Thanks in advance,
Danielle

Hi Dinis, Have exactly the

Liliplanet - July 4, 2009 - 09:19

Hi Dinis,

Have exactly the same problem.

Going through all node_types, nodes and variables and cleaned up everything. Still receive there is '1 item left to index' and a 'Invalid argument supplied for foreach() in /home/public_html/modules/taxonomy/taxonomy.module on line 1214'

Did you perhaps find a way to debug this, or a solution to the problem?

Look most forward to your reply (as also close to launch :)

Lilian

Any solution to this?

SomebodySysop - July 13, 2009 - 17:28

Same thing here. Any clues?

Hi, I've discovered what the

Liliplanet - July 21, 2009 - 08:35

Hi,

I've discovered what the problem is, but not quite sure how to fix it though ..

If you re-index the site, which I did at 200 per cron run, (checking dblog each time) and at some stage you will find the error in dblog 'Invalid argument supplied for foreach() in /home/public_html/modules/taxonomy/taxonomy.module on line 1214.'

Had a look in search_dataset and saw there was a 'node 0' that was indexed (in the past 200 indexes).

Deleted that 'node 0' in the search_dataset, but presuming it will try to index that again at the next cron run.

So, it's a search indexing issue .. that's all I can fathom at this point. Somewhere there is a node 0 related to a taxonomy term. How to find it is another mystery :)

ditto

owl - August 4, 2009 - 15:57

Hoping someone is popping up with the solution at any moment? :-)

Ditto

RogerB - September 14, 2009 - 13:47

Also having this exact problem. Would really like to hear of a solution.

Roger Bailey

We ran into this problem on

pkiff - September 16, 2009 - 19:57

We ran into this problem on our Drupal 6.13 install on an IIS 7 web server with PHP 5 and MySQL 5.

In our case, the problem was a corrupt node. I am not sure what caused the corruption, but I think that it was related to a failed attempt to save a revision of the node. By "failed" I mean that the save process did not complete correctly, and I received a PHP error, which I chalked up to a timeout issue. The result was that the page was no longer available at all: it produced a page not found error. But when I looked in the node table it was still there. And I also found it in the node_revisions table (we are using the Diff module).

In the node table, however, the corrupted node had a vid value of 0. If I understand correctly, that means that the node still existed, but it was no longer pointing to a valid revision containing valid content for that node. As a result, I could not find the page in any lists of published or unpublished content, and I therefore could no longer edit it via the Drupal interface. This was true even though I knew the node number (we are using clean URLs, and so I thought that perhaps manually entering in the right node variable into an edit URL string would allow me to edit the page, but no such luck). And whenever I tried to run a cron job to catch my search index up, I would end up with a single node left, along with that error about the taxonomy.module on line 1214.

Everything from here on I did via phpmyadmin.

To find the corrupted node, in my case, all I needed to do was sort the node table by vid, and then find the node that had a vid value of 0 (there was only one).

To fix the corrupted node, I sorted the node_revisions table by nid. Located the nid that matched the corrupted node. Found the vid value for the last revision of that nid. Then went back to the node table and replaced the vid value of 0 with this new vid value taken from the revisions_table.

After that, the page showed up correctly, and I was also able to complete a cron pass without error, finally indexing the last pesky node that wouldn't ever finish indexing before.

I'm not sure how all this relates to the taxonomy terms, so it is possible that this explanation is entirely unique to our database problem. But hopefully it will help someone in their troubleshooting.

Some additional hints on how to find which broken nodes may be causing this error are available here:

Invalid argument supplied for foreach() in taxonomy.module on line 1188:
http://drupal.org/node/259632

Phil.

 
 

Drupal is a registered trademark of Dries Buytaert.