Company News

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

December 7, 2012

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.

$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)

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

  1. Steve Mushkat says:

    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. Ryan J says:

    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.

    • MMMan says:

      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. 🙂

      • 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. Evan Riser says:

    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. Gabriel Torres says:

    This worked for me as well. Thanks.

  6. @SPJeff says:

    Glad you found the blog post helpful!

  7. Amin says:

    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

  8. vikrant singh says:

    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”.

  9. 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.

  10. Ravi says:

    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

  11. JESUS MORLA says:

    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

  12. Colin St Rose says:

    Worked like a gem…

  13. Keith Tuomi says:

    I find your blog very helpful and your writing style is impeccable. Keep up the good work!

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

    Keep up the good work !

    Martin

  15. Matthew Carter says:

    Thank you! Worked!

  16. Will says:

    The script was not working for me.

    This blog post worked for me:
    http://sensoft2000-sharepoint.blogspot.kr/2013/12/search-service-host-controller-struck.html

    Basically, needed to ensure the following services were running, as well:
    1. Net. Tcp Port Sharing Service
    2. Net. Tcp Listener Adapter
    3. Remote Registry
    4. Appfabric Caching Service

Leave a Reply

Colin Phillips

itgroove Alumni

Colin Phillips

Subscribe via Email

Categories

Powered by...

itgroove Corporate Profile
Connect With Us