Re-indexing of site stalled, & running cron won't advance I have a site recently moved from D6 to D7. The search in D7 was not finding nodes containing the search terms, so I began a re-index in the search settings. This has stalled at 11% of site (with 3570 items left to index), and running cron does nothing to advance the re-index. 

The log messages show that when cron runs, it encounters this error: 


  EntityMalformedException: Missing bundle property on entity of type
  comment. in entity_extract_ids() (line 7766 of
  /var/www/html/[domain]/includes/common.inc).


And this notice: 


  Notice: Undefined variable: key in comment_prepare_thread() (line 901
  of /var/www/html/[domain]/modules/comment/comment.module).


Also, there are many instances of this notice, which is associated with use of the site, not cron: 


  Undefined index: weblinks in custom_search_form_alter() (line 232 of
  /var/www/html/[domain]/sites/all/modules/custom_search/custom_search.module).


None of these seem to affect the function of the site, and it's not clear to me that they are actually related to the stalled re-indexing. But it's all I've got to go on at this point. 

If anyone could give me some ideas for how to troubleshoot this, I'd very much appreciate it. 

Thanks!
This problem was caused by discussion forum posts with a single comment from a user whose id was no longer in the user table (threads with more than one comment, even though one was from an invalid user id, did not cause the error). 

The fix was to find comments with invalid user ids, then change those ids in the Comment table to 0. 

This SQL query identified the problem user ids: 

SELECT DISTINCT a.uid FROM comment a left join users b on a.uid = b.uid 
WHERE b.uid IS NULL


With the problem user ids identified, you can either edit the table directly, or use UPDATE to change the column values. 

With those values changed in the comment table, the re-indexing proceeded to 100% without a hitch.