Uh-oh! Hosts File Error

Hello,
I’ve been running local (latest version - 5.6.8+4514) and it was working well previously, though pages load slower (front and backend) than they do on the web. Just a few days ago, however, I found that I could neither create a fresh install of WP nor Import a site because this error comes up before an installation can complete. Further, the error comes up even when starting an existing installation, though I was able to at least view/edit them in Chrome after closing the error message. I do remember that Windows 10 updated recently as well - I am now running 1909, so maybe this is a factor?

Anyway, I’ve read a number of posts here on the subject and tried recommended remedies including adding an exception for local in Bit Defender, making sure read-only is unchecked for the hosts file, replacing the hosts following Microsoft’s guide, uninstalling Bit Defender, turning on UAC, uninstalling/reinstalling local, and then doing a clean install, though the instructions are dated. Unfortunately, things have only gotten worse. I can neither view existing sites now nor install new ones, and I can’t seem to start fresh either.

This was very nearly disastrous as I have lost access to several months of work on this machine. But, thankfully I thought to export my work before attempting any fixes, and local still works on my laptop (though I worry not for long). From there I was able to import and then back up with duplicator.

So having averted disaster, and being grateful for that, I’m still left with the problem of not being able use local on my main machine. And admittedly, having seen several other posts on this topic remain unsolved, I’m concerned that posting might be fruitless. Nevertheless, having invested a good deal of time in getting the hang of local so far, I figured I should at least try this before moving on to something else. Any effort to help is much appreciated. Thank you.

Hey @Parris

The Uh-oh! Hosts File Error is one that does show up, and as you’ve read, is often due to some sort of security software, or change to the OS. The reason that this is such a hard thing to fix is that there’s usually some sort of setting buried deep within the computer that is preventing things from working.

For some background on what the Hosts file is – it’s a file that lets the computer know where to look for a site when you try to access it in a Web Browser.

Can you take a look at this FAQ post in the Community Forums and let me know if working through those troubleshooting steps fixes things for you?

Hey Ben,
Thank you for the quick reply. No, I’ve tried both steps recommended in that FAQ: removing the Read-only Attribute from the hosts file (was never checked) and adding an exception for the application in my antivirus which is Bit Defender. I mentioned that and other efforts in my original post. I also using LockHunter to see if the file is locked. It doesn’t appear to be. Any other suggestions?

Update: I’m up and running again in Local!

Reviewing the remedy of adding Local as an exception in Anti-virus again got me thinking. When I uninstalled BitDefender, I think Windows 10 reverted to using Windows Defender. Perhaps Defender then needed an exception added for Local as well. So I tried that. Unfortunately, I also saw that Windows Needed an update, and I triggered that as well. Hindsight, being what it is, I wish I did these two things independently. Then I would have been able to say definitively which of these actions solved the problem. I even tried removing the exception I just added to Windows Defender. But Local is still working after a reboot. So I don’t know.

In any case the update was 020-07 Cumulative Update Preview for .NET Framework 3.5 and 4.8 for Windows 10 Version 1909 for x64 (KB4562900). And the steps for adding an exception in Windows Defender are:

Add an exclusion to Windows Security

  1. Go to Start > Settings > Update & Security > Windows Security > Virus & threat protection.
  2. Under Virus & threat protection settings, select Manage settings, and then under Exclusions , select Add or remove exclusions .
  3. Select Add an exclusion, and then select from files, folders, file types, or process (here you want to navigate to C:\Program Files (x86)\Local and choose local.exe)

I’m glad you got it working and that’s great feedback, thanks!

Since Windows has so many different security and antivirus solutions, it’s sometimes to zero in on the exact thing that’s preventing Local from working, so great detective work!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.