Engineering Director at Vertigo Software RSS Feed


SharePoint 2007 Search Never Stops Crawling

We recently deployed Microsoft SharePoint Office Server 2007 (MOSS) and ran into an issue with the Office SharePoint Search Service. The Search service was stuck in the "Crawling Full" state. After about 1 week of troubleshooting with Microsoft Product Support, we have resolved our problem. In a nutshell, our Database Maintenance plan included a task to rebuild indexes which had a side effect of removing the ability to allow duplicate keys in the index which SharePoint Search requires. The lesson I learned here is to not include any index maintenance as part of your database back strategy for SharePoint 2007. For more details and how to fix the problem, please read on.

Problem

The problem appeared when we first noticed that our default Content Source for SharePoint Search was stuck in the "Crawling Full" state. During normal operation, once a crawl is complete, the status should change back to Idle.

The problem occurred because our Database Maintenance plan included a Rebuild Index Task that did not preserve the duplicate keys in the index when it was being rebuilt:

Fix

To fix the issue, we had to recreate the 2 indexes that were impacted. One is in the Shared Services Search database and the other is in the WSS 3.0 Search database. Please exercise caution when making these changes and make sure to have database backups before your start.

  1. Shared Services Search Database

    In the SharedServices Search Database, you must ensure that the IX_MSSAnchorPendingChangeLog index in the MSSAnchorPendingChangeLog table ignores duplicate values:

    If this is not enabled, you can follow the steps below to allow duplicate keys:

    1. In SQL Server Management Studio, navigate to the SSP Search database -> dbo.MSSAnchorPendingChangeLog -> IX_MSSAnchorPendingChangeLog index:

    2. Script out the index
    3. Delete the index
    4. Modify the SQL to set IGNORE_DUP_KEY = ON. Here is what our index script looked like (you will need to modify this script to use the appropriate database):

      -- TODO: change this to match the name of your SharedServices Search DB!
      USE [SharedServices_Search_DB]
      G
      O

      CREATE UNIQUE CLUSTERED INDEX [IX_MSSAnchorPendingChangeLog] ON [dbo].[MSSAnchorPendingChangeLog]

          [CrawlId] ASC
          [TargetDocId] ASC
      )WITH (PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = ON, ONLINE = OFF) ON [PRIMARY]

  2. WSS 3.0 Search Database

    In the WWS 3.0 Search Database, you must do the same as the SSP Search database and ensure that the IX_MSSAnchorPendingChangeLog index in the MSSAnchorPendingChangeLog table ignores duplicate values. If this is not enabled, you can follow the steps below:

    1. In SQL Server Management Studio, navigate to the WSS 3.0 Search database -> dbo.MSSAnchorPendingChangeLog -> IX_MSSAnchorPendingChangeLog index:

       

    2. Script out the index
    3. Delete the index
    4. Modify the SQL to set IGNORE_DUP_KEY = ON. Here is what our index script looked like:

      -- TODO: change this to match the name of your WSS Search Database Search DB!USE [WSS_Search_MOSSWEB01]
      GO

      CREATE UNIQUE CLUSTERED INDEX [IX_MSSAnchorPendingChangeLog] ON [dbo].[MSSAnchorPendingChangeLog]

          [CrawlId] ASC
          [TargetDocId] ASC
      )WITH (PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = ON, ONLINE = OFF) ON [PRIMARY]

  3. The final step, to ensure a clean Shared Services database, we created a new Shared Services Provider and removed the old one. We also removed the offending database maitenance plans.
 
Posted by Mike Hanley | 16 Comments | Trackback Url | Bookmark with:        
Tags:

Links to this Post

Comments

Wednesday, 31 Jan 2007 08:12 by Bug?
Great find and write up. Was having same issue, rebuilt the indexes and BAM! the crawl stopped. But I did not have an index rebuild in my maint plan but may have run DBCC DBREINDEX when it was first built. I haven't created a new SSP but will if we see any problems. Has MS declared this a bug or have a fix for it? Thanks! AB

Wednesday, 31 Jan 2007 04:23 by Re: Bug?
Hi AB, Microsoft Support was looking into reproducing the issue on their end and I believe they are going to write a KB article on the issue.

Monday, 5 Feb 2007 10:03 by Re: BIG BUG
Hi, The fix for this will most likely be rolled into SQL2005 SP2. It's definitely a big issue for Enterprise deployments with maintenance plans. Cheers, DaveL

Wednesday, 7 Feb 2007 03:41 by Huge Post!!! Thanks a ton!!! Solved our Problems!!
You rock! You've solved my problems. I originally had problems with my backup which led me to this solution. Basically my backup was working except for the Shared Service Search DB and the Shared Services Index. It was erroring out while it was running my full and incremental backups. I got this error: Shared Search Index failed in event OnPrepareBackup and another error: Error: Object Shared Search Index failed in event OnBackup. For more information, see the error log located in the backup directory. Object Shared Search Index failed in event OnPrepareBackup. For more information, see the error log located in the backup directory. WebException: The current operation timed-out after 3600 seconds I luckily noticed that my crawler was running and figured that had to be the reason that backup was failing, and thankfully I ran into your post. We've made the updates to the indexes and the crawler has stopped and the backups are working without errors again. Thanks for the post!!!

Wednesday, 21 Feb 2007 09:43 by Well it worked for a little bit!! But I got good news - for now!
I performed the steps above and everything appeared to be working. The crawler stopped and I was able to run incremental updates. However, I later found out that my incrementals weren't picking up anything. I cleared out the index and reran a Full Crawl, and bam, the indexer never stopped again. I doublechecked the two indexes from above and they were set to ignore duplicates. I figured, here goes another several days of troubleshooting or I'm going to have to pony up the cash to call PSS, but my prayers were answered. Thankfully did a quick search on the Knowledge Base. I ran across this article - http://support.microsoft.com/kb/930887/en-us I updated all of the SPS2007 indexes and rebuilt them. My crawl stopped, I reset the index and performed a full crawl. Full crawl worked, I did an incremental and it worked as well. Will keep you all posted if anything changes. Note: someone on another blog posted that you can delete values from the tables that have crawlid and the crawler will stop. I did that several times, but got tired of rebuilding the shared services db. It should be fine if you make the index changes and rebuild them. Hope this helps and good luck.

Wednesday, 21 Feb 2007 11:11 by Well it worked for a little bit!! But I got good news - for now!
I performed the steps above and everything appeared to be working. The crawler stopped and I was able to run incremental updates. However, I later found out that my incrementals weren't picking up anything. I cleared out the index and reran a Full Crawl, and bam, the indexer never stopped again. I doublechecked the two indexes from above and they were set to ignore duplicates. I figured, here goes another several days of troubleshooting or I'm going to have to pony up the cash to call PSS, but my prayers were answered. Thankfully did a quick search on the Knowledge Base. I ran across this article - http://support.microsoft.com/kb/930887/en-us I updated all of the SPS2007 indexes and rebuilt them. My crawl stopped, I reset the index and performed a full crawl. Full crawl worked, I did an incremental and it worked as well. Will keep you all posted if anything changes. Note: someone on another blog posted that you can delete values from the tables that have crawlid and the crawler will stop. I did that several times, but got tired of rebuilding the shared services db. It should be fine if you make the index changes and rebuild them. Hope this helps and good luck.

Tuesday, 13 Mar 2007 12:46 by Kind of the Same issue I think...
When running the backups within MOSS 2007 I get the error below. I have not setup a maintenance plan as of yet by the issues seem to be simular. Any help would be appeciated. Error: Object Shared Search Index failed in event OnPrepareBackup. For more information, see the error log located in the backup directory. WebException: The current operation timed-out after 3600 seconds [3/6/2007 11:52:03 AM]: Debug: at Microsoft.Office.Server.Search.Administration.SearchSharedApplication.Microsoft.SharePoint.Administration.Backup.IBackupRestore.OnPrepareBackup(Object sender, SPBackupInformation args) at Microsoft.SharePoint.Administration.Backup.SPBackup.RunPrepareBackup(SPBackupRestoreObject node)

Thursday, 19 Apr 2007 02:04 by Having issues while backing farm
I am having the same issue while trying to back up a server farm. I got this error: Shared Search Index failed in event OnPrepareBackup and another error: Error: Object Shared Search Index failed in event OnBackup. For more information, see the error log located in the backup directory. Object Shared Search Index failed in event OnPrepareBackup. For more information, see the error log located in the backup directory. WebException: The current operation timed-out after 3600 seconds. I verified on the indexes that the Ignore duplicate is checked and that my crawler is not running. But i still cannot back up my farm. Can you please give some inputs.

Monday, 23 Apr 2007 12:50 by Having problems backing up the farm
I am also having an error backing up the farm. All components completed fine except for the following: Shared Search Index Preparing backup 4/23/2007 2:45 PM Object Shared Search Index failed in event OnPrepareBackup. For more information, see the error log located in the backup directory. UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) The crawl is idle and all searching seems fine. Anyone have any ideas?

Monday, 23 Apr 2007 01:01 by Similar Issues with backup of farm
I am also having issue with the backup. Only the Shared Search Index portion fails. Here is the message: Shared Search Index Preparing backup 4/23/2007 2:45 PM Object Shared Search Index failed in event OnPrepareBackup. For more information, see the error log located in the backup directory. UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) The crawl is idle. Any ideas?

Friday, 8 Jun 2007 07:54 by Issues with backup of farm
Does your search application use a different service account than your Application Pool service account? In that case, you may need to add DCOM permissions to the SPSearch application for the Search account. Go to Administrative Tools->Component Services. Drill down to My Computer and DCOM Config. Find the SPSearch component, right click and view properties and then Security. In all three categories, click "Customize" and "Edit" and make sure that both accounts have access locally (and remotely to be sure).

Wednesday, 27 Jun 2007 10:11 by Issues with backup of farm - me too
I´ve got a single-server installation of Sharepoint Server 2007. After having OnPrepareBackup and OnBackup errors (UnauthorizedAccessException: Access Denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))) I ran accross this post. The setps I followed were: * Install SQL Server 2005 SP2 * Follow http://support.microsoft.com/kb/930887/en-us * Go to and modified the entries for SPSearch under Component Services Still no luck. The script of the index already comes with "IGNORE_DUP_KEY = ON" so I really don´t know what else to do. Any help?? Thanks in advance,

Wednesday, 25 Jul 2007 05:04 by Same Boat here
I am getting the same errors to. The errors are occuring for each database that is hosted in the farm. Heeelp...??? Thanks Stumped SP Sue

Wednesday, 29 Aug 2007 03:47 by Hotfix for stsadmin backup problem
Hi guys We had similar problems with our single server installation (using SQL 2005 SP2) where the backup using stsadmin would hang and time out after an hour for the various search components in sharepoint. We logged a call with Microsoft PSS and they sent us hotfix 939592, which fixed the problem in our case. After installing it, run this as well:- 1. Click Start, click Run, type cmd in the Open box, and then click OK. 2. Change to the following directory: system drive \Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin 3. Run the following command: psconfig -cmd upgrade -inplace b2b Hope that helps. Ray

Thursday, 3 Jan 2008 02:13 by ACCESS DENNIED ???
Object Shared Search Index failed in event OnPrepareBackup. For more information, see the error log located in the backup directory. UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Wednesday, 20 Aug 2008 08:28 by techie
Thanks Mike for the post. It helped me resolve my issues with sharepoint search.

Name:
URL:
Email:
Comments:

CAPTCHA Image Validation