Local has overwritten my entire hosts file - Windows 10, Local 6.7.0

Bug Summary

Don’t know exactly when/how, Local has entirely overwritten my hosts file, so that the only entries left are those between

Local - Start


Local - End

Steps to reproduce

Most probably when Local failed to import a site and the entire list of sites disappeared.

Environment Info

  • What Operating System are you using? Windows 10
  • What versions of site software (Nginx, Apache, PHP, MySQL) is used? N/A
  • What version of Local is installed? 6.7.0

Hi @swaip

So you were trying to import a site, that failed and then all of your other sites in your Local app disappeared? Are you still able to local the site files on your machines somewhere?

Could you share your Local Log with us? Retrieving Local’s Log File

Hi Nick-B, thanks for answering.
Actually no, I SUPPOSE overwriting of the hosts file happened when I tried to import a site.
What I’m sure of, is that the import deleted the LIST of local sites (“You haven’t created any site yet” when I restarted Local), but NOT the actual folders of the sites. I then re-imported them one by one.

Hi @swaip I’m glad you were able to find and retrieve the sites to re-import them.

Would you mind sharing a copy of your Local Log? Retrieving Local’s Log File

Also, do you know if you have any security, firewall or anti-virus applications running?

Here it is !
I have Avira Free Security.

Thanks for your help !

local-logs.zip (124 KB)

Hi @swaip

I’m seeing a lot of connection or update-type errors in the logs indicating that the machine may have been blocking or limiting Local. Usually, this comes from things like security applications so Avira could have played a part. Local does make changes to the host file but wiping out your previous sites is a new one for me unless something caused the files to get shifted like an update of some sort.

In the Local Log there are errors mentioning things like getaddrinfo ENOTFOUND and could not update hosts and the last couple of errors in the Router Log look like this:

2023/03/17 14:36:32 [error] 5200#1840: *96 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: ::1, server: energy-savings.local, request: "GET /wp-content/plugins/wp-mail-smtp/assets/images/reports/icon-note.png HTTP/1.1", upstream: "", host: "energy-savings.local"
2023/03/17 18:16:06 [crit] 24584#22144: *11 SSL_write() failed (10053: An established connection was aborted by the software in your host machine) while sending to client, client:, server: jam.local, request: "GET / HTTP/1.1", upstream: "", host: "jam.local", referrer: "https://jam.local/"

We have some more details about troubleshooting security or port conflicts here that might be helpful: Router Mode

I also just noticed multiple errors like this in the logs as well:

{"stack":"Error: ENOSPC: no space left on device, write","level":"warn","message":"Unable to import site.","timestamp":"2023-03-17T09:40:05.857Z"}

Is it possible your machine ran out of room? It may have aborted the import and then had a crash of some sort.