for-win icon indicating copy to clipboard operation
for-win copied to clipboard

System.InvalidOperationException: Failed to deploy distro docker-desktop

Open rsdmike opened this issue 6 years ago • 46 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [x] I have uploaded Diagnostics
  • Diagnostics ID: E707C486-C1D9-47D8-9EB8-D285CDEA4902/20200512030235

Expected behavior

Docker Desktop boots on startup

Actual behavior

Docker fails to start with:

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\Mike\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: Error: 0xffffffff


 stderr: 
   at Docker.Core.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\WslCommand.cs:line 119
   at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__16.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 142
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__6.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__23.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

Information

  • Windows Version: Version (2004)10.0.19041 Build 19041.208
  • Docker Desktop Version: 2.3.0.2
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No

Steps to reproduce the behavior

Unsure if the following will reproduce..

  1. Ensure WSL2 is enabled
  2. Install Docker-Desktop - say yes to using WSL2 when prompted
  3. Reboot

Other info - I have Ubuntu 20.04 LTS installed from the windows store, i use Windows Sandbox as well.

rsdmike avatar May 12 '20 04:05 rsdmike

@benhillis the 0xffffffff error on deploying a distro is still the wsl service crash related to HNS and port 43 right ?

@rsdmike By any chance, have you run Docker Desktop in Windows containers previously ?

simonferquel avatar May 13 '20 08:05 simonferquel

I have joust updated my 3 developer computers to Win10(2004) and WSL2 And is now getting the exact same error on all 3 computers. two have been set to Windows containers but the last have only had linux containers enabled..

Kilsgaard avatar May 13 '20 10:05 Kilsgaard

do you see this when trying to upgrade a wsl1 distro to wsl2 as well ? (like wsl --set-version Ubuntu 2)

simonferquel avatar May 13 '20 10:05 simonferquel

Yes I do PS C:\Users\GKi> wsl -l -v NAME STATE VERSION

  • WLinux Stopped 1 Ubuntu Running 1 PS C:\Users\GKi> wsl --set-version Ubuntu 2 Conversion in progress, this may take a few minutes... For information on key differences with WSL 2 please visit https://aka.ms/wsl2 Error: 0xffffffff

Kilsgaard avatar May 13 '20 11:05 Kilsgaard

Ok so the good news (for me) is that the issue does not come from Docker Desktop! I think the issue is related to processes listening on port 53 (dns). Can you check if some process does that, then restart lxss service and try again?

simonferquel avatar May 13 '20 11:05 simonferquel

Correct, the -1 error indicates an issue creating the virtual network.

benhillis avatar May 13 '20 14:05 benhillis

Yes netstat says that I have a listening service on port 53, proberly the company antivirus.. is there a way to get arround this?

Kilsgaard avatar May 14 '20 10:05 Kilsgaard

@simonferquel Only Linux containers have been configured on this machine, haven't used Windows Containers. This problem seems intermittent, sometimes a reboot fixes it, other times it doesnt. I don't see anything listening on port 53 for me. I upgraded to distro wsl2, and will keep ya posted if it happens again.

rsdmike avatar May 14 '20 17:05 rsdmike

I have found the problem, got permission to remove our corporate antivirus from one of my developer machines, and now I can run WSL 2 It looks like (heimdalsecurity.com) is capturing port 53 when it is installed :-(

Kilsgaard avatar May 14 '20 18:05 Kilsgaard

@simonferquel I am still seeing this even after upgrading to WSL2 for the distro of Ubuntu 20.04 LTS :(

You had asked if i have had Windows Containers enabled previously -- i had mentioned i use Windows Sandbox in the original post, which after some reading I understand uses container technology underneath which would obviously be Windows. Would these two technologies(Sandbox and WSL2) be conflicting?

rsdmike avatar May 20 '20 01:05 rsdmike

@rsdmike what about port 53 ? can you check with netstat ?

simonferquel avatar May 20 '20 08:05 simonferquel

image

Killing the process and re-trying to launch docker gives me the same error. However, waiting a bit longer and trying again -- Docker launched! I guess the question is -- why is dockerd tripping on itself?

rsdmike avatar May 20 '20 16:05 rsdmike

I had the same problem with jhi_service.exe image This was the Intel(R) Dynamic Application Loader Host Interface service. Everything worked once I stopped that service.

NickHeap2 avatar Jul 10 '20 14:07 NickHeap2

For me it was Hyper-V - everything is working fine after disabling it.

daserge avatar Jul 15 '20 14:07 daserge

Disabling Hyper-V also helped me.

sapinder avatar Jul 17 '20 06:07 sapinder

I had a dns proxy called "Acrylic" that was listening on port 53. Docker-desktop started fine after I removed Acrylic

pn141 avatar Aug 02 '20 18:08 pn141

I don't understand all the people that are 'okay' with disabling Hyper-V. I think it's a desparate and very poor solution to the problem. What about the people using Hyper-V?

Any tips... I do a netstat -aon | findstr ":53" and see that there is a couple of hits:

  TCP    192.168.64.1:53        0.0.0.0:0              LISTENING       45392
  UDP    0.0.0.0:53             *:*                                    31272
  UDP    0.0.0.0:53             *:*                                    31272
  UDP    192.168.64.1:53        *:*                                    45392

I tried killing these suckers, but doesn't help me. It looks like it's the UDP Port 53 on on PID 31272, which for me is Internet Connection Sharing. This service is running for some reason. I don't explicitely use ICS, but it's getting enabled because of something. I tried stopping it, access denied. I tried setting startup to disabled, but in the Windows Event Viewer it is noted that it was automatically set back to Manual (triggered) again.

Any other ideas?

Futher findings: After messing a LOT with killing and stopping/starting services (WITHOUT REBOOTING) suddenly docker now started and is running. No idea what I did or how it suddenly started.

KiLLeRRaT avatar Aug 10 '20 23:08 KiLLeRRaT

I had the same issue and after switching back and forth from windows containers to linux containers and rebooting it magically started working. My guess is that it's an issue with other app's using that port before docker can use it during the login sequence. but so far it has been unreliable on win 2004 with the kali and ubuntu wsl containers installed.

b1kjsh avatar Aug 25 '20 20:08 b1kjsh

I had the same issue on my Win 10 machine. Yesterday I switched to windows containers and then back to linux containers, then I shut down my pc for the night, and today I faced this problem. Killing dockerd.exe solves the problem.

simonachmueller avatar Aug 26 '20 08:08 simonachmueller

I keep reading above people disabling Hyper-V, how is it possible then to have Docker Desktop for Windows running without Hyper-V?? When I disable it in the BIOS I get an error when starting Docker Desktop. image

JannemanDev avatar Sep 04 '20 13:09 JannemanDev