Asked by:
The search service is not able to connect to the machine that hosts the administration component

Question
-
Running Sharepoint 2013. I removed the Search Service Application which was broken. I set it up manually through Central Administration and Powershell but I get the same result when I go to manage the Search Service Application:
System Status:
Administrative status The search service is not able to connect to the machine that hosts the administration component. Verify that the administration component 'cb7d26ed-8075-48ed-9f2f-39a44ecbf419' in search application 'Search Service Application 2' is in a good state and try again.
Search Application Topology:
Unable to retrieve topology component health states. This may be because the admin component is not up and running.I tried the following:
- changed the app pool from SharePoint Web Services Default to SharePoint Web Services System
- deleted and recreated Search Service Application
- The service account does have access to the search databases
- one account is used, domain\spadmin, has all necessary permissions that I can see
Also, upon checking the Application Event Log on the Sharepoint server I see errors that indicate that Sharepoint is trying to access a deleted Search Database. The database is not listed in SQL, Get-SPDatabase, or CA\UpgradeAndMigration\ReviewDatabaseDtatus.
A database error occurred. Source: .Net SqlClient Data Provider Code: 4060 occurred 0 time(s) Description: Error ordinal: 1 Message: Cannot open database "Search_Service_Application_DB_deleted" requested by the login. The login failed.
________________________
A database error occurred. Source: .Net SqlClient Data Provider Code: 18456 occurred 0 time(s) Description: Error ordinal: 2 Message: Login failed for user 'domain\user'., Class: 14, Number: 18456, State: 1 at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)________________________
Could not access the Search database. A generic error occurred while trying to access the database to obtain the schema version info.Context: Application '127eeac5-2939-4fae-8dba-15feae0a7307'
Details:
(0x80131904)I'm fairly new to Sharepoint and at this point I'm ready to rebuild it. No users yet, it's still in development, but I don't want to lose any of the site collections. Any suggestions?
Thursday, August 8, 2013 1:17 PM
All replies
-
You can use this script to create search service application and start all services on local server.
Before execute, change settings based on your environment - index location, service pool settings, and also database server name.
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Settings $IndexLocation = "C:\Search" #CREATE FOLDER FOR INDEX BEFORE RUN SCRIPT! (Location must be empty, will be deleted during the process!) $SearchAppPoolName = "Services Pool" #ADD YOUR SERVICES POOL NAME! $SearchAppPoolAccountName = "DOMAIN\SP_Services" #ADD YOUR SERVICES POOL ACCOUNT $SearchServiceName = "Search Service Application" $SearchServiceProxyName = "Search Service Application Proxy" $DatabaseServer = "DatabaseServer" #CHANGE SERVER NAME TO YOU OWN $DatabaseName = "SearchServiceDB" Write-Host -ForegroundColor Yellow "Checking if Search Application Pool exists" $spAppPool = Get-SPServiceApplicationPool -Identity $SearchAppPoolName -ErrorAction SilentlyContinue if (!$spAppPool) { Write-Host -ForegroundColor Green "Creating Search Application Pool" $spAppPool = New-SPServiceApplicationPool -Name $SearchAppPoolName -Account $SearchAppPoolAccountName -Verbose } else { Write-Host -ForegroundColor Yellow "Search Application Pool $SearchAppPoolName is already exist, nothing to do" } Write-Host -ForegroundColor Yellow "Checking if Search Service Application exists" $ServiceApplication = Get-SPEnterpriseSearchServiceApplication -Identity $SearchServiceName -ErrorAction SilentlyContinue if (!$ServiceApplication) { Write-Host -ForegroundColor Green "Creating Search Service Application" $ServiceApplication = New-SPEnterpriseSearchServiceApplication -Name $SearchServiceName -ApplicationPool $spAppPool.Name -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName } Write-Host -ForegroundColor Yellow "Checking if Search Service Application Proxy exists" $Proxy = Get-SPEnterpriseSearchServiceApplicationProxy -Identity $SearchServiceProxyName -ErrorAction SilentlyContinue if (!$Proxy) { Write-Host -ForegroundColor Green "Creating Search Service Application Proxy" New-SPEnterpriseSearchServiceApplicationProxy -Name $SearchServiceProxyName -SearchApplication $SearchServiceName } $ServiceApplication=Get-SPEnterpriseSearchServiceApplication $searchInstance = Get-SPEnterpriseSearchServiceInstance -local if(-not($searchInstance.Status -eq "Online")) { Write-Host -ForegroundColor Green "Starting local service instance..." -NoNewline $searchInstance|Start-SPEnterpriseSearchServiceInstance while ($searchInstance.Status -ne "Online") { Write-Host -ForegroundColor Green "." -NoNewline Start-Sleep -Seconds 5 $searchInstance = Get-SPEnterpriseSearchServiceInstance -local } Write-Host -ForegroundColor Yellow "Done!" } $InitialSearchTopology = $ServiceApplication | Get-SPEnterpriseSearchTopology -Active $SearchTopology = $ServiceApplication | New-SPEnterpriseSearchTopology New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $SearchTopology -SearchServiceInstance $searchInstance New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $SearchTopology -SearchServiceInstance $searchInstance New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $SearchTopology -SearchServiceInstance $searchInstance New-SPEnterpriseSearchCrawlComponent -SearchTopology $SearchTopology -SearchServiceInstance $searchInstance New-SPEnterpriseSearchAdminComponent -SearchTopology $SearchTopology -SearchServiceInstance $searchInstance set-SPEnterpriseSearchAdministrationComponent -SearchApplication $ServiceApplication -SearchServiceInstance $searchInstance Remove-Item -Recurse -Force -LiteralPath $IndexLocation -ErrorAction SilentlyContinue mkdir -Path $IndexLocation -Force New-SPEnterpriseSearchIndexComponent -SearchTopology $SearchTopology -SearchServiceInstance $searchInstance -RootDirectory $IndexLocation Write-Host -ForegroundColor Green "Activating new topology" $SearchTopology.Activate() Write-Host -ForegroundColor Yellow "Next call will provoke an error but after that the old topology can be deleted - just ignore it!" $InitialSearchTopology.Synchronize() Write-Host -ForegroundColor Yellow "Deleting old topology" Remove-SPEnterpriseSearchTopology -Identity $InitialSearchTopology -Confirm:$false Write-Host -ForegroundColor Green "Old topology deleted" Write-Host -ForegroundColor Green "Done - start a full crawl and you are good to go (search)."
Best regards, Andrii
Thursday, August 8, 2013 1:34 PM -
Thanks. I ran the script and it's been sitting at "Creating Search Service Application" for over 30 minutes. Checking Central Admininistration, I can see the Search Service Application has been created (no proxy though). And in SQL, all databases have been created.
Errors in event log:
The Execute method of job definition Microsoft.Office.Server.Search.Administration.CustomDictionaryDeploymentJobDefinition (ID ad105b9d-8e9a-44a5-bae1-a648a6833030) threw an exception. More information is included below.
The search service is not able to connect to the machine that hosts the administration component. Verify that the administration component '90e381e4-47fe-4a37-81c9-963e69865d95' in search application 'Search Service Application' is in a good state and try again.
- Proposed as answer by rfarris2000 Tuesday, June 3, 2014 1:21 PM
Thursday, August 8, 2013 5:40 PM -
Hi Nika,
It is a single server farm installation, right ? Does your user has necessary rights on SQL server?
Regards,
Tapan
Thursday, August 8, 2013 6:08 PM -
Single server - standalone installation. I double-checked and the user does have the necessary rights in SQL.Thursday, August 8, 2013 6:19 PM
-
For the heck of it, I added 'securityadmin' role to the user account in SQL and the Search Application Topology came up with checks marks on all expect for 'Crawler'. Same error on System Status though.
Thursday, August 8, 2013 6:25 PM -
Check firewall settings - and if it enabled - disable and try again.
Best regards, Andrii
Thursday, August 8, 2013 8:50 PM -
Disabled firewall - same results.Friday, August 9, 2013 12:53 PM
-
Make sure you've installed the NDP45-KB2759112-x64 prereq, even if it was initially installed rerun to see if this corrects the issue, you'll need to reboot after the install.
MCITP-EA | "Never test how deep the water is with both feet"
Saturday, August 10, 2013 2:01 PM -
I've had much better results with the search service if the following updates are installed BEFORE SHAREPOINT 2013 IS EVEN INSTALLED.
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=406
If SharePoint is already installed, I don't have much luck resolving this error.
Please mark my response as an answer if appropriate.
Learn.SharePoint.comSunday, August 11, 2013 6:00 AM -
The updates were installed prior to installing SharePoint. I'll rerun the KB2759112 update and see what happens.Monday, August 12, 2013 1:21 PM
-
let me rephrase - Run windows update on your OS until there are no more udpates, not even optional ones. then ensure the following updates are installed. After restarting, more updates will pop up as available. Keep installing and rebooting until there are no more updates to download and install.
KB2472264, KB2554876, KB2708075, KB2765317
This is all BEFORE you install SharePoint 2013
Believe me, this works if you do it
Please mark my response as an answer if appropriate.
Learn.SharePoint.com
- Edited by Learn.SharePoint.com Monday, August 12, 2013 5:36 PM
Monday, August 12, 2013 4:26 PM -
Try this http://technet.microsoft.com/en-us/library/ee704553.aspx
Let me know!
AJ MCTS: SP 2010 Configuration MCSA: Windows 7 If you find this post useful kindly please mark it as an answer :) TY
Tuesday, August 13, 2013 7:49 PM -
Hi Nika.
First of all, have you tried running SharePoint Products Configuration Wizard 2013 and just go thru the steps "Do not disconnect this server from farm" and "Continue tho host the website" just to make sure your installation is in good state.
Then I would like to ask you to run the following from SP Powershell to make sure the services is not facing some loopback auth check issues... If you haven't run it already.
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -value "1" -PropertyType dword
Restart the SharePoint Server after this and check if the Search Admin Component is more successfull.
I know another one posted a PS script to create the Search Service already, but i will post one as well as I have successfully used many times.
Note that you have to change the -account on the first line appropiately, as well the SharePoint_Search DB name if you would like another standard.
$saAppPoolName = new-spserviceapplicationpool –name "Search Service Application" –account DOMAIN\USER $searchServerName = (Get-ChildItem env:computername).value $serviceAppName = "Search Service Application" $searchDBName = "SharePoint_Search" $saAppPool = Get-SPServiceApplicationPool $saAppPoolName Write-Host "Starting Search Service Instances..." Start-SPEnterpriseSearchServiceInstance $searchServerName Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $searchServerName Write-Host "Creating Search Service Application and Proxy..." $searchServiceApp = New-SPEnterpriseSearchServiceApplication -Name $serviceAppName -ApplicationPool $saAppPoolName -DatabaseName $searchDBName $searchProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name "$serviceAppName Proxy" -SearchApplication $searchServiceApp Write-Host "Configuring Search Component Topology..." $clone = $searchServiceApp.ActiveTopology.Clone() $searchServiceInstance = Get-SPEnterpriseSearchServiceInstance New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance $clone.Activate()
Best Regards.
PhilipTuesday, August 13, 2013 10:00 PM -
Hi Philip,
Thank you for all of your suggestions. I ran the Configuration Wizard, followed by the command from Powershell, restarted the server, and got the same errors.
When I ran the script you provided, I get the following error after '$clone = $searchServiceApp.ActiveTopology.Clone()':
Exception calling "Clone" with "0" argument(s): "The Operation is not allowed when you have a Standalone Installation."
Also, all updates were already installed prior to installing SharePoint.
Thx-
Nika
Friday, August 23, 2013 3:53 PM -
Hi Nika.
Ok, I must have missed that this was a standalone install.
I guess you have re-runed the Search Component setup?
If you still get the same error as mentioned at the end of this post, could you try running the following PS command:
Get-SPEnterpriseSearchAdministrationComponent
Identity of your search adm component, as your exception points to on a earlier post from you.
90e381e4-47fe-4a37-81c9-963e69865d95
Your earlier post:
The search service is not able to connect to the machine that hosts the administration component. Verify that the administration Component '90e381e4-47fe-4a37-81c9-963e69865d95' in search application 'Search Service Application' is in a good state and try again.
EDIT: I forgot that you need to apply ID of your current error message, since it of course would not be the same once you re-installed the service. :)
My bad..
You can also check in IIS - SharePoint Web Services for your search app id.
It will contain the SearchService.svc.
Best Regards.
Philip
- Edited by Philip Kusel Wednesday, August 28, 2013 2:30 PM rewrite of ID
Wednesday, August 28, 2013 2:26 PM -
Hi Philip,
Thanks for getting back to me. I ran Get-SPEnterpriseSearchAdministrationComponent and received only a “FALSE” value for “Initialized”.
I checked IIS-SharePoint Web Services, and noticed there were two entries that pointed to the same SearchService.svc. I deleted both entries and also deleted the Search Service App once again to start from scratch.
After deletion I noticed the same errors in the Event Logs pointing to Search apps and databases that have long been deleted:
Could not access the Search database. A generic error occurred while trying to access the database to obtain the schema version info.
Context: Application '127eeac5-2939-4fae-8dba-15feae0a7307-crawl-0' ___________________________________________________________________________
Could not access the Search database. A generic error occurred while trying to access the database to obtain the schema version info.
Context: Application '127eeac5-2939-4fae-8dba-15feae0a7307' ___________________________________________________________________________
A database error occurred. Source: .Net SqlClient Data Provider Code: 4060 occurred 0 time(s) Description: Error ordinal: 1 Message: Cannot open database "Search_Service_Application_DB_d5103090ada14e45a1d4c615f255d541" requested by the login. ___________________________________________________________________________
I searched the registry and found several keys that point to these apps and databases located here:
“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\15.0\Search\Applications\127eeac5-2939-4fae-8dba-15feae0a7307\ResourceManager
AND
“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\15.0\Search\Applications\127eeac5-2939-4fae-8dba-15feae0a7307-crawl-0\ResourceManager
Do you think it's safe to remove these keys (both 127eeac5-2939-4fae-8dba-15feae0a7307 AND 127eeac5-2939-4fae-8dba-15feae0a7307-crawl-0)?
Thanks,
Nika
Thursday, August 29, 2013 5:30 PM -
Hi,
I have faced this same issue in our SharePoint 2013 environment, I have fixed this issue by following below steps
Analysis: Execute below PS command in SharePoint Management Shell to verification of cause of this issue
Get-SPTimerJob job-application-server-admin-service | flIt will return IsDisabled : True
Solution: Execute below PS command in SharePoint Management Shell to fix this issue
Enable-SPTimerJob job-application-server-admin-service
Now it will return IsDisabled: False
To verify it execute command
Get-SPTimerJob job-application-server-admin-service | fl
Restart SharePoint Timer Service
IISRESETReference : http://www.sharepointexcellence.com/2014/01/the-search-service-is-not-able-to_22.html
Vivek Jagga - MCTS SharePoint 2010
My Blog
- Proposed as answer by Parthasarathy.Srinivasavaradharajan Friday, January 24, 2014 4:55 AM
- Edited by Vivek Jagga Friday, May 16, 2014 9:49 AM
Thursday, January 23, 2014 6:33 PM -
Thanks. You save me a lot of work. Elegant solution.Sunday, January 26, 2014 1:24 PM
-
Hi Nika, did you ever find a solution to this issue as I am facing a similar one.
Cheers
Rob
Wednesday, May 7, 2014 9:09 AM -
I can always get Search to provision using the GUI but PowerShell seems to fail with errors above. I checked the timer job as suggested but it was already enabled.
Dennis Bottjer | Follow Me: @dbottjer | Blog: Dennis Bottjer.com
Monday, November 3, 2014 6:39 PM -
I just faced the same issue. The problem was the job-application-server-admin-service timer job.
Running the PS command 'Get-SPTimerJob job-application-server-admin-service | fl' gave no result, and it seemed that the timer job itself was gone.
Running 'stsadm -o installfeature -name SharedServices -force' added the timer jobs and everything started working ..
- Proposed as answer by HN.S Friday, April 6, 2018 8:31 AM
Friday, January 30, 2015 11:09 AM -
This one finally fixed my issue! We spent 3 1/2 days going through the 50 different fixes for the error "Search service is not able to connect to the machine that hosts the administration component". I've deleted and rebuilt the app with Central Admin and via PowerShell, and always this error showed up. I'm not sure why or what broke Search - but this simple stsadmn command fixed it! Thank you!Friday, July 13, 2018 4:40 PM
-
I faced the exact same issue. I can't thank you enough. I've been working with MS on this issue for 3 weeks. This was the final fix.
My issue was the same, search related timer jobs were not there. Same error message as above when visiting the search service page. Admin component wouldn't load.
Wednesday, May 8, 2019 1:44 PM