Blocked at updating host file 75%

hello,
all in the title.
i done all the autorisations to write the file.
can i change the host file myself with the code instead ?
and what is the code ?
thanks

Dealing with the same issue, have been digging pretty far into it over here: Can't connect to database DK0033 - #18 by cphollingdale

1 Like

If you’re editing the host file yourself, it just needs the following:

127.0.0.1 website.local
127.0.0.1 www.website.local
::1 website.local
::1 www.website.local

The thread linked to above may provide steps that can be looked into if you’re running Windows. It’s possible that the host file is blocked on your machine from being able to edit.

Hello, I’m having the same problem:

Host File update failed. DK0022
When install a new site he’s blocked at 75%
When retry its gives the same error.

I’m working on Windows 10 Home
Host file read only is unchecked
We did also some modifications in the anti-virus

With Local wp I was having the same problem, an eprm error with the host file, so I’ve switched for DevKinsta in the hope this wil work.

I am new to WordPress and want to try things out, so I love to get DevKinsta working.
Thanks a lot

Hi Lien, welcome to DevKinsta, we’re glad to have you!

Can you edit your hosts file normally with a text editor like notepad and save the changes?
Do the changes you make stay when you open the file again?

Yes,
I’ve put the following rules as suggested above and after saving, closing, reopening they are still there.

127.0.0.1 website.local
127.0.0.1 www.website.local
::1 website.local
::1 www.website.local

Try this:

When you first run DevKinsta, right-click on it and click ‘run as administrator’.

Let me know how that works.

Still the same error

When checking the host file, its was set again on read only.

I can’t reply anymore so I put it here,
Hope You will see it

image

No error output.
The Hosts file has been updated with: #### This is a test file insert

Can you try opening up a privileged (ran as administrator) command prompt and run the following command?

echo #### This is a test file insert >> C:/Windows/System32/drivers/etc/hosts & echo.

That should insert a line into your hosts file or output an error we can hopefully diagnose.

Hi,
I have same problem. I echoed with CMD and got text inserted in hosts file without output of errors. ( http://prntscr.com/101uo0y ).
I tried to open DevKinsta with administrator privileges but same problem it stops at 75% and can’t modify hosts file. ( http://prntscr.com/101upkf ).
I added manually what DevKinsta tries to add itself and made site accessible in browser but problem is that DevKinsta app is trying to modify hosts file and doesn’t allow clicks in the app.

Hi there,
any update on this?

Have been trying to use DevKinsta for some time now, but it won’t work.
It keeps blocking at the hosts-file edits… Manual editing and echoing into the hosts-file works.
And I’m running everything as admin user…

Is there any way to debug this any further? A colleague of my has no trouble using DevKinsta at all.

Hi @rafu . I’m sorry for the trouble here. Would you happen to have any anti-virus software running in the background that would perhaps be blocking the action?

Hi @michael,
just plain old Windows Defender. Is there any settings for ‘locking’ the hosts file? I couldn’t find any…

As I mentioned, editing it with Notepad++ in admin mode is no problem. Also the echoing into the host file is possible with a privileged command prompt.

@rafu Would you be able to disable Windows Defender to see if that helps?

Unfortunately no changes…

I completely disabled Windows Defender and all its components (including things like ‘tamper protection’) and also added the hosts-file to the Defender’s excluded files - still not working.

I also tried switching docker from using WLS2 to the slower Hyper-V which gave me some Docker wants to share <some-dev-kinsta-dir>-messages, that I haven’t seen before…
Also, I disabled Windows UAC, but still no changes.

@michael Do you have any idea?

Hi @rafu. I’m sorry for the wait. Perhaps try icalcs command to update the permissions of the host file.

Example:
icacls \Windows\System32\drivers\etc\hosts /grant YOUR_USERNAME_HERE:(OI)(CI)F /T

Be sure to run Command Prompt in administrator mode as well:

Let me know if that works for you.

Hi @michael,
I was able to run your command without the (OI)(CI)-flags, but unfornately, that did not do the trick for DevKinsta. Still blocking at 75%. However, I now am able to edit the hosts-file without admin rights (checked with Notepad++, that formerly had to be run in administrator mode to modify the hosts-file).

The (OI)(CI) flags are only available for directories only, as the link you provided documents. I tried running them on the parent-dir (the etc-dir), but only got an access denied-error. And I am also not able to edit the folders permissions via the Windows GUI-Tool. The options for allowing/denying access are disabled:
image

I’d be happy to try anything else, if you haven’t run out of ideas yet? :slight_smile:

Thank you for testing that @rafu . I’m sorry again for the issues. The developers are aware of the issue and are working on a solution. Thank you again for using DevKinsta!