Thursday, October 6, 2011

Troubleshooting Search Service stuck in "Stopping State" ...

I have recently experienced this issue: search service stuck in "Stopping" state after last crawl.
After trying almost everything I had in mind:
  • restart IIS 
  • restarting the service from the services.msc 
  • trying to stop the service from Central Administration "Services in Server"
  • manually ending the process in Task Manager
  • trying power shell to stop the service using the command "Stsadm -o osearch -action stop"
  • trying to unprovision the content sources
And after all of the above I was still getting the error:

'stop' action failed. Additional information: Invalid search service unprovisioning: application 'Search Service Application' still has a ready component 'd9078ea1-0869-46f7-92d6-d89500f03abf-query-0' on server 'SPFARM2010'.

So I had to finally do enforce the security on the server - this way basically we "unlocked" the component that was faulting the provisioning of the search service. This was done by using the following power shell command:

psconfig.exe -cmd secureresources

Do not panic from the output message. It looks a bit scary:

SharePoint Products Configuration Wizard version 14.0.6009.1000. Copyright Microsoft Corporation 2010. All rights reserved.

Performing configuration task 1 of 5
Initializing SharePoint Products upgrade...

Waiting to get a lock to upgrade the farm.

Successfully initialized SharePoint Products upgrade.

Performing configuration task 2 of 5
Initiating the upgrade sequence...

Successfully initiated the upgrade sequence.

Performing configuration task 3 of 5
Securing the SharePoint resources...

* * *

After all of the steps are done, the farm will be online again.
Have in mind that this command also enforced the security on files, folders, and registry keys, but did the magic - our search service was back to it's normal state 

No comments: