Typically I won't blog about an error until I've encountered it a few times. Here's an exception to the rule. I had never come across this error and it caught me off guard during a recent installation of MOSS. Usually when I've seen Event ID 6482, it's been because of the IIS lock (see previous post: SharePoint Exception Errors: Event ID 6398, Event ID 6482, Event ID 7076). However, this was a different error description.
So why on earth is my hosts file missing? After some online research, it appears that the host file is deleted/modified by the SharePoint timer service after you've made some changes to the WFE that is crawled by the search service.
Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server Shared Services
Event ID: 6482
Time: 8:37:54 PM
Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (dbb94537-db22-448b-92c9-d1f684a4a13e).
Reason: Could not find file 'C:\WINDOWS\system32\drivers\etc\HOSTS'.
Techinal Support Details:
System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\system32\drivers\etc\HOSTS'.
File name: 'C:\WINDOWS\system32\drivers\etc\HOSTS'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at Microsoft.Search.Administration.Security.HOSTSFile.ParseHOSTSFile(Hashtable& HOSTSFileMappings, StringBuilder& HOSTSComments)
at Microsoft.Search.Administration.Security.HOSTSFile.ConfigureDedicatedGathering(SearchServiceInstance searchServiceInstance, SPServer dedicatedWebFrontEndServer, IList`1 previousWebApplicationHostNames)
at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.SynchronizeDefaultContentSource(IDictionary applications)
at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
To resolve this error, you have two things you have to do.
- Create a new hosts file at C:\Windows\system32\drivers\etc\
The contents of a default hosts file typically looks like this:
- Once you've created the hosts file, you need to apply appropriate permissions for WSS_Admin_WPG to it. If you don't, you are just going to encounter another error (This time a permission error: Access to the path 'C:\WINDOWS\system32\drivers\etc\HOSTS' is denied).