Tuesday 17 May 2016

The service '/SearchAdmin.svc' cannot be activated due to an exception during compilation. The exception message is: The farm is unavailable.

Hi,
I am Sandeep. Recently I had gone through the issue in my SharePoint 2013 Environment.
I have 2 servers in my SharePoint farm. I am getting more than 100 event logs on one of the SharePoint server. So I tried to check what is the issue and finally I found the issue and it got resolved by following the below steps.

Event Log:
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/3382020
Exception: System.ServiceModel.ServiceActivationException:
The service '/SearchAdmin.svc' cannot be activated due to an exception during compilation. The exception message is: The farm is unavailable.

Issue Caused:
In our SharePoint server, few components are NOT working in Search Service Application.

Search Service Application -- System Status.
Administrative status: All Errors
Crawler background activity: All Errors


Resolution:
  1. Open the IIS Manager -- Expand the Server Name -- Select Application Pools
  2. Find the Application Pool name which has created with the identity of Search-Service Account and note-down the Application Pool name.
  3. Go to Sites -- Expand the SharePoint Web Services
  4. Select the 1st entry(Ex: 0h37hs5789ti3j988s0f08wr3iu9p) which has added in the list.
  5. Right-click on mouse and select Switch to Content View in the options.
  6. Find the SearchAdmin.svc in the Content view panel. (If you did not found the SearchAdmin.svc, then check the other entries below until you get)
  7. Once you found the SearchAdmin.svc from the respective entry, then click the same entry once-again and see the Basic Settings in right-hand side.
  8. Click the Basic Settings -- In the Application pool box, check if the correct application pool was selected. (Refer the 2nd point which is related to Search-Service)
  9. If the different application pool is selected, then change it to Search-Service Application pool name. To change the application pool, click on the Select button and in another window you will get list of application pools which is registered. Select the appropriate Application pool and click OK to apply the changes.
  10. The same changes to be made in the another SharePoint server in the farm.
  11. Then do the IIS RESET through Command prompt and check the Search Service Application status.
Result:
Search Service Application -- System Status.
Administrative status: Running
Crawler background activity: None


Everything is working as expected.
Thank you..!!!