Closed ninten closed 3 years ago
I am pretty sure this is caused by your antivirus software. but - if this is only for that process, you could just remove -updatehosts and avoid the hosts file update mechanism - which is mostly for when you need to access the container from a browser or vs code.
Strange thing - get the same error here on my notebook.
Adding the -isolation hyperv parameter solves the issue for me
What anti-virus software are you running - and what happens if you exclude c:\windows\system32\drivers\etc from antivirus?
What anti-virus software are you running - and what happens if you exclude c:\windows\system32\drivers\etc from antivirus?
Kaspersky, managed by our security department. Can't exclude any files or disable the anti virus 😞
Ok, pretty sure that kaspersky is the issue. If you don't use -updateHosts it probably also works - not sure if you can access the container then though. BTW - my windows 10 2020H2 actually works without updatehosts.
Unfortunately the container is not reachable without the updateHosts - and you are miles away from the Win Version available for us 😅 Pretty sure, too that Kaspersky is the issue - didn't had the issue a week ago..
I am pretty sure this is caused by your antivirus software. but - if this is only for that process, you could just remove -updatehosts and avoid the hosts file update mechanism - which is mostly for when you need to access the container from a browser or vs code.
Unfortunately we tried removing our antivirus software (Windows Defender) and -updateHosts and we still get the same issue. Our only workaround has been switching to an azure Windows 10 machine with Docker Desktop and it seems to be working fine, but we would like to make it run in our local servers 😥.
I don't know what local policies you have on your local servers, but if something works on a freshly installed Azure VM and not on your local server, then it is likely some local policy or software blocking things. These things can take ages to troubleshoot. I would recommend that you shift to artifacts and ensure that you are running compatible container and host OS' - that should remove most of the incompatibility issue we have seen and then you would have to disable local policies and other things until it works. Fighting these things very often really doesn't pay off - I was helping another partner, where their pipelines where running fine and then suddenly one day everything stopped. Everybody looked at windows updates or docker, but it ended up being the IT department who had enabled some security policy, which caused these things. IMO - agents should be something you never access with RDP and the machine should not be under normal desktop security settings. My agents are created using http://aka.ms/getbuildagent - and if they fail - I delete them and create a new (btw - the partner from before ended up adopting that) Another possible way is to use Azure Hosted agents.
Closing this one as there is nothing really I can do to solve it.
We use an agent to create a container, install some apps, execute tests and remove the container. After some runs, the agent creation gets stuck (in a random step), and we found out that opening the file "C:\Windows\System32\drivers\etc\hosts" unblocks the process and it finishes successfully. If we don't unblock it on time, it fails and all subsequent builds will fail too until the machine is restarted and the stuck container removed manually.
This is how we create the container:
And this is how we remove it:
The stack: