Search Host Controller Service in “Starting” state (SharePoint 2013)

I ran into exactly this issue as described by the post below.

http://blog.mwiedemeyer.de/post/2012/10/11/Search-Host-Controller-Service-in-Starting-state

On the "Services on Server" page, the "Search Host Controller Service" showed the status "Starting".

Basically, running the following PowerShell as the Farm Admin Account (run as administrator in PowerShell) solves the issue.

[sourcecode language=”powershell”]
$acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName
$person = [System.Security.Principal.NTAccount] "Users"
$access = [System.Security.AccessControl.RegistryRights]::FullControl
$inheritance = [System.Security.AccessControl.InheritanceFlags] "ContainerInherit, ObjectInherit"
$propagation = [System.Security.AccessControl.PropagationFlags]::None
$type = [System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)
$acl.AddAccessRule($rule)
Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl
$sh = Get-SPServiceInstance | ? {$_.TypeName -eq "Search Host Controller Service"}
$sh.Unprovision()
$sh.Provision($true)
[/sourcecode]

Basically, the first part is setting (correcting) some registry settings, and then the Search Host Controller Service is being reprovisioned.

Be aware, this service is being provisioned as the user who you’re running the PowerShell as. I ran into an unrelated issue with the Admin account’s password not being stored in Central Admin (it may have been changed at some point between when Central Admin was setup and now), so it prompted me to set the password in Central Admin (via another PowerShell command “Set-SPManagedAccount”). Again, this was unrelated, but I couldn’t run the last step, “Provision”, until I had resolved this.

Many thanks to Marco Wiedemeyer and SPJeff!

23 responses to “Search Host Controller Service in “Starting” state (SharePoint 2013)

  1. Fixed the issue, thanks! One minor edit to the PS script, add in “” characters to the registry path for the Get-acl and set-acl cmdlets:

    HKLM:SystemCurrentControlSetControlComputerName

  2. Excellent article, something to keep in mind for multi-server deployments, however, is that $sh = Get-SPServiceInstance | ? {$_.TypeName -eq “Search Host Controller Service”} will return ALL the instances (i.e. every server), not just the broken one.

    Consequently, running the $sh.Unprovision() and $sh.Provision($true) commands will generate an error similar to Exception calling “Unprovision” with “0” argument(s): “The executing code must run on server .” and “Exception calling “Provision” with “1” argument(s): “This service instance ‘Search Host Controller Service’ cannot be provisioned on server ” because it is mapped to server ‘server2’.” This error will happen no matter where it’s run in the farm.

    The best way to ensure you have the right server is to do a Get-SPServiceInstance | ? {$_.TypeName -eq “Search Host Controller Service”}, look for the correct (i.e. broken server’s) GUID, then do $sh = Get-SPServiceInstance | ? {$_.SearchServiceInstanceId -eq “GUID from above”} (there’s probably some better way to get the correct GUID using a one-liner, but I’ll leave that to the PS guru’s – i.e. not me 😉 )

    Now your $sh.Unprovision() and $sh.Provision($true) will work as expected and fix the error.

    1. Thanks Ryan. Good point. Many of our clients are small enough that they won’t have more than one machine, but this isn’t necessarily a common situation. 🙂

      1. Thanks Ryan! I have a multi-server configuration with the exact problem you described. I was able to quickly isolate the guilty server, and ran the code to unprovision the Search Host Controller. Once this was done, I could re-run AutoSPInstaller to complete the configuration.

  3. Thanks for this post as it saved a 2013 deployment I ran using autospinstaller.
    To build on Ryan’s point I found that you can replace the lookup portion…
    “Get-SPServiceInstance | ? {$_.TypeName -eq “Search Host Controller Service”}”

    with

    “Get-SPServiceInstance | ? {$_.PrimaryHostController -eq “True”}”
    In this case you can at least isolate the instance which is the “primaryhostcontroller” which is a parameter unique to the Search Host Controller SP Service (thus it doesn’t pull back other services).

  4. I had the same issue – my farm was three-tier, streamlined topology – DB, App and WFE. All with Windows Server 2012, SQL 2012, SharePoint 2013 RTM. I tried everything I found in internet, but the host controller service didn’t started. My resolution was to add all features from .NET 3.5 and .NET 4.5, including all kind of WCF activations (except MSMQ activation).

  5. when i try script i get this error:

    Exception calling “Provision” with “1” argument(s): “Cannot start service
    SPSearchHostController on computer ‘.’.”
    At C:shcont.ps1:12 char:1
    + $sh.Provision($true)
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : InvalidOperationException

  6. Thanks, adding all the .net compoenents helped me in fixing service “Search Host Controller Service ” in windows 2012. However I am still getting an error in Sharepoint 2013 on editing or completing any form “The server was unable to save the form at this time. Please try again”.

  7. Thanks! Very helpful! I just had this issue in a 4 server farm, so to expand a little further for a multi-server farm…

    Replace:
    $sh = Get-SPServiceInstance | ? {$_.TypeName -eq “Search Host Controller Service”}

    With these two lines of code:
    $hostname = hostname
    $sh = Get-SPServiceInstance | ? {$_.TypeName -eq “Search Host Controller Service”} | ? {$_.Server -match $hostname}

    Then run the script on each one of the servers in the farm, the above two lines will get the Service Instance running on the same server you’re running the script on.

  8. While provisioning i am getting the below exception. can you please provide your thoughts?

    Exception calling “Provision” with “1” argument(s): “Time out has expired and
    the operation has not been completed.”
    At line:1 char:1
    + $sh.Provision($true)
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TimeoutException

  9. I have the same error
    While provisioning i am getting the below exception. can you please provide your thoughts?

    Exception calling “Provision” with “1″ argument(s): “Time out has expired and
    the operation has not been completed.”
    At line:1 char:1
    + $sh.Provision($true)
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TimeoutException

  10. Great Article ! Solved my issue with hunging “Search Host Controller Service ” in SharePoint 2013 after upgrading to SP1.

    Keep up the good work !

    Martin

Comments are closed.