docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.85k stars 287 forks source link

An error occurred: Docker.Core.HttpBadResponseException #6807

Open ponokwai opened 4 years ago

ponokwai commented 4 years ago

Expected behavior

Starting Docker Desktop for Windows, I attempted to run a linux container but it fails to start-up

Actual behavior

I get "An error occurred. See exception below:

Docker.Core.HttpBadResponseException: Unhandled exception: Operation failed with result 32775 at Docker.Core.Logging.ClientExceptionInterceptor.d0.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\Logging\ClientExceptionInterceptor.cs:line 17 --- 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.Core.Logging.LoggingMessageHandler.d4.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\Logging\LoggingMessageHandler.cs:line 37 --- 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 System.Net.Http.HttpClient.d58.MoveNext() --- 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.Core.HttpClientExtensions.d11.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\HttpClientExtensions.cs:line 22 --- 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.Core.BackendAPI.BackendAPIClient.<StartHyperVVMAsync>d__11.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\BackendAPI\BackendAPIClient.cs:line 102 --- 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.LinuxHyperVEngine.<DoStartAsync>d__12.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\LinuxHyperVEngine.cs:line 60 --- 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 36 Original stacktrace: at Docker.Backend.HyperVInfrastructure.<HandleMaybeAsyncJob>d__37.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 744 --- 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.Backend.HyperVInfrastructure.<StartVMAsync>d__29.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 588 --- 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.Backend.HyperV.<StartAsync>d__7.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperV.cs:line 101 --- 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.Backend.HttpAPI.HyperVAPIController.<StartAsync>d__8.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Backend\HttpAPI\HyperVAPIController.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 System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__11.MoveNext() --- 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 System.Web.Http.Controllers.ApiControllerActionInvoker.d1.MoveNext() --- 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 System.Web.Http.Controllers.ActionFilterResult.d5.MoveNext() --- 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 System.Web.Http.Dispatcher.HttpControllerDispatcher.d__15.MoveNext()

Information

Version: 2.3.0.2 (45183) Channel: stable Sha1: e9b671cd3cb844cb63ad6fd7c79a4d15424233c4 Started on: 2020/05/20 12:31:21.748 Resources: C:\Program Files\Docker\Docker\resources OS: Windows 10 Enterprise Edition: Enterprise Id: 1703 Build: 15063

Steps to reproduce the behavior

  1. Start up docker desktop defaulting to linux container

log.txt

adiguno commented 4 years ago

I had the same issue, when trying to 'reset to factory defaults'

StruninIhor commented 4 years ago

The same issue. Attached log file log.txt

marivaldojr commented 4 years ago

I had that issue when trying to 'reset to factory defaults'. I notice that on Hyper-V Manager the DockerDesktopVM was in state "Paused-Critical", then I turn off and on again. After I could start the Docker Desktop.

richardgragasin commented 4 years ago

any updates? im having similar issues on my cloud vm.

ankurgupta15 commented 4 years ago

@ponokwai did you get solutions for the above error because i am getting the same error and not able to resolve it yet.

ponokwai commented 4 years ago

@ankurgupta15 I never did. I gave up on running docker locally. I just deploy to Azure and manage it there

grzegorzsobocinski2397 commented 4 years ago

I had the same issue after Docker Desktop update (2.3.0.4 46911). Going into Hyper-V Manager and restarting the service helped.

ravigupta84 commented 3 years ago

Thanks @grzegorzsobocinski2397 It worked for me. I opened The Hyper-V Manager then stop and start the service.

docker-robott commented 3 years ago

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

StruninIhor commented 3 years ago

/remove-lifecycle stale

docker-robott commented 3 years ago

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

StruninIhor commented 3 years ago

/lifecycle frozen

StruninIhor commented 3 years ago

/remove-lifecycle stale

bzaks1424 commented 2 years ago

/remove-lifecycle stale

bzaks1424 commented 2 years ago

I'm getting the same exception. on boot Windows Version 10.0.19043 Build 19043

Faulting application name: Docker Desktop.exe, version: 4.1.1.0, time stamp: 0xb4d6f9e7
Faulting module name: KERNELBASE.dll, version: 10.0.19041.1202, time stamp: 0xc9db1934
Exception code: 0xe0434352
Fault offset: 0x0000000000034f99
Faulting process id: 0x3118
Faulting application start time: 0x01d7c1e2516b20ad
Faulting application path: C:\Program Files\Docker\Docker\Docker Desktop.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 1e38336a-94da-492c-ab1a-7e38ffd4f668
Faulting package full name: 
Faulting package-relative application ID: 
Application: Docker Desktop.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException

Exception Info: Docker.Core.HttpBadResponseException
   at Docker.Core.Logging.HttpClientExceptionInterceptor+<InterceptResponseAsync>d__0.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Docker.Core.IPC.Client+<SendAsync>d__5.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at System.Net.Http.HttpClient+<FinishSendAsyncBuffered>d__58.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Docker.Core.BackendAPI.ServiceAPIClient+<UpdateHostsAsync>d__5.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Docker.Core.TaskExtension+<Forget>d__0.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
oDn commented 2 years ago

I've been having the exact same issue as @bzaks1424 for months now.

Docker Desktop is not configured to start automatically when I log in. When I run Docker Desktop 4.5.1 (74721) the first time it crashed but succeeds when starting it again a couple of minutes later. In both cases Windows 10 21H2 (19044.1566) is fully booted up and WSL2 is running without any issues.

Reyhn3 commented 2 years ago

I too had the exact same problem as @bzaks1424. I solved it by:

  1. Uninstalling Docker Desktop and restarted.
  2. Uninstalling the Windows features "Windows Subsystem for Linux" and "Hyper-V" (don't know if Hyper-V needs to be uninstalled, though) and restarted.
  3. Reinstalled "Windows Subsystem for Linux" and restarted.
  4. Reinstalled Ubuntu as WSL and restarted.
  5. Reinstalled the latest Docker Desktop and restarted.

When I installed Docker Desktop again, I ran from PowerShell:

Start-Process 'Docker Desktop Installer.exe' -Wait -ArgumentList ("install","--accept-license","backend=wsl-2")

This worked for me.

1zyik commented 1 year ago

I tried out MircoK8s and it messed with the default VM giving the same error.

My solution didn't require a restart.

Open CMD with admin privileges and paste

sc config LxssManager start=auto

This reverts the default VM back to wsl2. Hope it helps.

anthonrodgrs01 commented 1 year ago

This error occured to me when I made changes in the wslconfig file, I copied and pasted all the stuff from the documentation to my wslconfig file, but all I needed was to limit docker desktop to 4gb of ram and processors

All you should try doing is delete all the lines except the ram and no. of process from wslconfig file: it should look like this:

.wslconfig file-:

[wsl2] memory=4GB processors=2

Jan-Snoeijs commented 1 year ago

I tried out MircoK8s and it messed with the default VM giving the same error.

My solution didn't require a restart.

Open CMD with admin privileges and paste

sc config LxssManager start=auto

This reverts the default VM back to wsl2. Hope it helps.

This doesn't work.