Nov12

SharePoint Event ID 6482: Could not find file 'C:\WINDOWS\system32\drivers\etc\HOSTS'.  

Categories: Errors

Typically I won't blog about an error until I've encountered it a few times.  Here's an exception to the rule.  smile_sniff  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.

Error Detail:

image

Event Type:    Error
Event Source:    Office SharePoint Server
Event Category:    Office Server Shared Services
Event ID:    6482
Date:        11/12/2008
Time:        8:37:54 PM
User:        N/A
Computer:    YOURSERVER
Description:
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 System.IO.FileInfo.OpenText()
   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.Search.Administration.SearchServiceInstance.Synchronize()
   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.

Error Resolution:

To resolve this error, you have two things you have to do.

  1. Create a new hosts file at C:\Windows\system32\drivers\etc\

    image 

    The contents of a default hosts file typically looks like this:
    # Copyright (c) 1993-1999 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    
    127.0.0.1       localhost

  2. 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).

    image

- Dan

 
Share It:          
 
 

Links to this post

Comments

Duncan  commented on  Thursday, January 29, 2009  7:44 PM 

These permissions need to be applied to the etc folder itself and not just the host file otherwise SharePoint will delete the file and will not be able to recreate it.

Dan Lewis  commented on  Thursday, January 29, 2009  7:52 PM 

Thanks Duncan! I don't remember doing that, but thanks for the added tip.

MOSS2010  commented on  Tuesday, April 07, 2009  5:18 AM 

Thanks a lot.

The permission to the etc folder did the trick.

I was wondering why the hosts file always disappeared and now everything just works fine.

Thank you very much

João Costa  commented on  Wednesday, April 15, 2009  11:25 AM 

Ok great.

M.E.  commented on  Tuesday, June 09, 2009  2:50 PM 

that sucks !
...but it's true

Aaron Bertsch  commented on  Tuesday, June 23, 2009  6:39 AM 

Thanks for the tip! Fixed problem right up.

Jesus  commented on  Thursday, July 16, 2009  8:48 AM 

uh okay thats great and all but how do I get to that part where I can apply appropriate permissions for WSS_Admin_WPG. How do I get to that menu.

Dan Lewis  commented on  Friday, July 17, 2009  11:08 AM 

Like other file system items, your right-click on it and select Properties. Then you click on the Security tab.

That's where the permissions are set.

James Ontra  commented on  Wednesday, May 26, 2010  5:06 PM 

Worked great. Thanks. This was driving me nuts.

Leave a comment





CAPTCHA Image Validation