docker / for-win

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

Docker Desktop fails to start/run on Windows startup #10958

Closed stevenobird closed 1 year ago

stevenobird commented 3 years ago

Actual behavior

Docker fails to start on Windows startup. This can be witnessed when the Docker icon in the taskbar tray stops animating without the "containers" shown on the icon. When trying to open the UI for Docker Desktop, it doesn't even open or loads infinitely. Restarting the Docker Desktop.exe and the com.docker.service service fixes this issue - until the next Windows reboot.

Expected behavior

Docker Desktop starts and stays in an "operative" state

Information

I am using Docker solely in my WSL 2 environment which has an Ubuntu 20.04 installed. Checking error log files in %localappdata%\Docker\log.txt seem not to hint at anything I could work with:

[02:10:38.196][GoBackendProcess ][Info ] msg="accepted data connection on unix:\\.\pipe\dockerVpnkitData" [02:10:38.203][GoBackendProcess ][Error ] msg="error accepting multiplexer data connection: The pipe is being closed." [02:10:38.203][GoBackendProcess ][Info ] msg="listening on unix:\\.\pipe\dockerVpnkitData for data connection" [02:10:38.203][GoBackendProcess ][Info ] msg="DNS: UDP server has connected" [02:10:38.203][GoBackendProcess ][Warning] msg="ignored error: EOF"

[02:10:58.682][VpnKitBridge ][Error ] msg="windows: ssh-auth: cannot compute local path of service. Is the VM vpnkit-bridge out-of-sync with the host?" [02:10:58.682][VpnKitBridge ][Error ] msg="windows: osxfs-data: cannot compute local path of service. Is the VM vpnkit-bridge out-of-sync with the host?"

[02:11:01.124][VpnKit ][Error ] vpnkit.exe: Starting to watch : EINVAL [02:11:01.124][VpnKit ][Error ] vpnkit.exe: Failed to watch hosts file : invalid argument ... [02:11:01.128][VpnKit ][Error ] vpnkit.exe: While watching /etc/resolv.conf: ENOENT ... [02:11:01.135][VpnKit ][Error ] vpnkit.exe: Pipe.listen: caught (Failure "Failed to connect vmnet device")

Steps to reproduce the behavior

  1. Start Windows and wait Docker Desktop and Docker service to start and run
  2. See Docker being in an unoperative state (Docker commands do not work, etc.)
jslow421 commented 3 years ago

Seeing the same issue. Reinstalled WSL, Ubuntu, and Docker (3.3.3) to no avail. Still have to manually launch docker after it fails. No vpn here, but for the sake of trying something I did sign out of my docker account. No change.

mcacker commented 3 years ago

Well, the bug is back for me. After rebooting, I can no longer get it to run.

How about some input from the Docker team, this is pretty poor.

MaximoTrinidad commented 3 years ago

@mcacker,

It will help to know which Windows 10 Insider build you're having issues with docker. I'm in the process to install the next update: "Windows 10 Insider Preview 21382.1 (co_release)".

I will verify after it's done!

mcacker commented 3 years ago

@MaximoTrinidad I don't know what an Insider Preview is, but I'm running

Docker Desktop 3.3.2 (63878).
Microsoft Windows 10 Enterprise 10.0.19042 Build 19042 WSL 5.4.72

I was leary of installing 3.3.3 as I thought I was OK, and didn't want to change anything.

mcacker commented 3 years ago

BTW, I just tried @12trey's suggestion of

DockerCli.exe -SwitchDaemon

I had to perform it twice, but it did end up working. Don't know what it's doing, but it got me going

flopes89 commented 3 years ago

To anyone still experiencing this; I have had this issue from the very beginning. And though it might not help in every environment, I have since uninstalled Docker Desktop entirely. I am now exclusively using docker in WSL2 (Ubuntu) "natively".

You of course lose the Windows Integration in things like IntelliJ but at least you can start and run containers without issues. Port and directory mapping works like a charm for me.

jslow421 commented 3 years ago

Not sure if it's relevant, but I see this in event viewer:

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 Docker.Core.Logging.LoggingMessageHandler+<SendAsync>d__4.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.BackendAPIClient+<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()

Followed by

Faulting application name: Docker Desktop.exe, version: 3.3.3.64133, time stamp: 0x89ea8de2
Faulting module name: KERNELBASE.dll, version: 10.0.19041.964, time stamp: 0x812662a7
Exception code: 0xe0434352
Fault offset: 0x0000000000034b89
Faulting process id: 0x54c8
Faulting application start time: 0x01d74c16faaab5aa
Faulting application path: C:\Program Files\Docker\Docker\Docker Desktop.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: f9609703-dfd8-480f-b361-141497df8fd9
Faulting package full name: 
Faulting package-relative application ID: 
sassner commented 3 years ago

Also still not resolved for me with 3.3.3.

jslow421 commented 3 years ago

I am not certain if this helps at all for anyone more experienced than I. Grabbed some logs that appear to be from the last few days. Always fails to start at Windows login, runs fine manually after that.

log.txt

MaximoTrinidad commented 3 years ago

@sassner, @jslow421,

Yes! docker v3.3.3 doesn't work in WSL2 after upgrading from v3.3.2.

I had to uninstall 3.3.3 an go back to 3.3.2 and I got everyhing working again. My WSL2 - UBUNTU 20.04

(base) maxt@mxtlpt01:~$ docker --version
Docker version 20.10.6, build 370c289
(base) maxt@mxtlpt01:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
(base) maxt@mxtlpt01:~$

Windows WSL (Windows 10 Insider build 21387)

PS C:\Users\max_t> WSL --status
Default Distribution: Ubuntu-20.04
Default Version: 2

Windows Subsystem for Linux was last updated on 4/28/2021
WSL automatic updates are on.

Kernel version: 5.10.16
PS C:\Users\max_t> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-20.04           Running         2
  Ubuntu-18.04           Stopped         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2
PS C:\Users\max_t>
PS C:\Users\max_t> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.21387
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
belucha commented 3 years ago

See #11169 for me the problem was solved, after signing out.

salwaen commented 3 years ago

Run docker v3.3.3 with admin rights working for me.

jslow421 commented 3 years ago

See #11169 for me the problem was solved, after signing out.

No joy on that fix for me.

Run docker v3.3.3 with admin rights working for me.

Personally, I don't really want to have a UAC popup every time I boot (I assume that happens in this instance). Would prefer it if could just go back to the pre 3.3.3 behavior. The workaround that I'm using is to just manually run docker once I'm in windows.

CPTechnikVX commented 3 years ago

I can confirm that after logging out Docker starts up without VPN connection.

geekonthepc commented 3 years ago

Signing out of Docker Desktop also fixed this issue for me AT LAST. Been dodging the upgrade for weeks now. Docker sure is getting unreliable :(

MartinDahlKilt commented 3 years ago

Also experiencing this issue. I've had major stability issues with Docker for Windows and WSL and VPN. Sometimes it just works flawlessly other times it won't even start - VERY annoying!! Please prioritize this issue and get it fixed once and for all - Especially now that we are forced to accept updates. Every time there is an update, I cringe and pray for it to still be working afterward - I think Docker is the only application I have this experience with.

ayuina commented 3 years ago

Just "sign-out and sign-in with docker id" works for me, in docker desktop version 3.3.3. But it's just workaround.

GaddipatiAsish commented 3 years ago

Just "sign-out and sign-in with docker id" works for me, in docker desktop version 3.3.3. But it's just workaround.

This hack worked for me. Thanks.

moulinette commented 3 years ago

Just "sign-out and sign-in with docker id" works for me, in docker desktop version 3.3.3. But it's just workaround.

Worked for me too. Thanks

O5ten commented 3 years ago

Just "sign-out and sign-in with docker id" works for me, in docker desktop version 3.3.3. But it's just workaround.

Another one here!

josh9383 commented 3 years ago

Below steps resolved for me

  1. Taskbar icons --> Right Click on Docker icon --> Click TroubleShoot from the context menu
  2. Click - Clean/Purge Data button
  3. Select all data sets - Hyper-V, WSL 2, Windows Contaienrs
  4. Wait for cleanup to complete
  5. Quit Docker desktop as : Taskbar icons --> Right Click on Docker icon --> Click Quit
  6. Start Docker desktop again

image

agumaxwellforcode commented 3 years ago

@stevenobird

Restarting the Docker Desktop.exe and the com.docker.service service fixes this issue - until the next Windows reboot.

could you expand on this? I have restarted the Docker Desktop.exe and also restarted the service with pwsh admin Restart-Service com.docker.service but it doesn't seem to fix the issue for me - though everything else seems exactly as you describe.

That's really the only two steps I do to temporarily fix the issue. I stop Docker Desktop.exe with the Task Manager under "Details" tab and switch to "Services" tab to restart com.docker.service (which should be similar to doing it with Powershell). After that, I manually open up Docker Desktop.exe again and everything boots up as it should.

Hmm, that doesn't seem to work for me but if I go into the troubleshooting part of the docker desktop app and purge hyperv data it forces a restart of the docker service and boots up again, keeping my wsl2 images etc because it's using the WSL2 engine instead.

It could just be me not doing the Windows service restarts right etc, but it's an easier workaround anyway tbh.

I purged HyperV and it works now

jslow421 commented 3 years ago

@josh9383 excuse my ignorance but just to confirm, this process will remove any persistent storage for containers as well?

josh9383 commented 3 years ago

@josh9383 excuse my ignorance but just to confirm, this process will remove any persistent storage for containers as well?

@jslow421 I am not certain about that . Mine is a development desktop so I did not have to consider this impact as such.

jorgerojasmata commented 3 years ago

It's a problem happening from a long time ago. All hacks described here seems to work 'only once'.

Seems the service hangs on user session startup, maybe it tries to load or connect to Docker service BEFORE is properly initialized, and the error is really badly controlled.

Why I think so? Because it uses to happen on first login after system restart, AND when it happens, loggin off and login in works almost 100% of the cases.

So, you login and make a lot of changes because it don't work, then logoff and login, and you think the hacks helped. WRONG: Just loggin off and loggin in makes it.

MaximoTrinidad commented 3 years ago

in my case, because I"ve been uninstalling and reinstalling throughout different versions. think doing the additional steps of Purging before reinstalling might help.

But Definitely, after installation, sign off/on, then restarting the "Docker Desktop Services" did clear my issue. Even after rebooting, now it works.

Windows 10 Insider

Microsoft Windows [Version 10.0.21390.2025]

WSL2 - Ubuntu-20.04/Docker 3.4.0

(base) maxt@mxtlpt01:/mnt/c/Users/max_t$ docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.17
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        f0df350
 Built:             Wed Jun  2 11:56:47 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:54:58 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.6
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
(base) maxt@mxtlpt01:/mnt/c/Users/max_t$

(base) maxt@mxtlpt01:/mnt/c/Users/max_t$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  compose: Docker Compose (Docker Inc., 2.0.0-beta.3)
  scan: Docker Scan (Docker Inc., v0.8.0)
WARNING: Plugin "/usr/libexec/docker/cli-plugins/docker-app" is not valid: failed to fetch metadata: fork/exec /usr/libexec/docker/cli-plugins/docker-app: no such file or directory

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.16.3-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.624GiB
 Name: docker-desktop
 ID: 6W42:TO3V:KLVF:MXLV:QLWY:ZH7H:6HSO:UCMX:VNEN:RBOB:KBB7:AZ26
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
(base) maxt@mxtlpt01:/mnt/c/Users/max_t$

WSL2

Default Distribution: Ubuntu-20.04
Default Version: 2

Windows Subsystem for Linux was last updated on 4/28/2021
WSL automatic updates are on.

Kernel version: 5.10.16
jslow421 commented 3 years ago

Thus far I've purged data, logged out and back in, reinstalled docker and WSL, and updated docker versions a few times now. Sadly, nothing has yet resolved it. I've gotten to the point where I've just made peace with the new step in my morning procedure. If anyone happens across something new, I'd be appreciative.

Also, still seeing this in the event viewer:

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__4.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.BackendAPIClient+<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()
Faulting application name: Docker Desktop.exe, version: 3.5.1.0, time stamp: 0x8c3f2661
Faulting module name: KERNELBASE.dll, version: 10.0.19041.1081, time stamp: 0xde3fc775
Exception code: 0xe0434352
Fault offset: 0x0000000000034ed9
Faulting process id: 0x5f2c
Faulting application start time: 0x01d76e3ce568ab92
Faulting application path: C:\Program Files\Docker\Docker\Docker Desktop.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 25f84150-b79c-490e-b0c8-3d78744a9c1d
Faulting package full name: 
Faulting package-relative application ID: 
os-kingsley commented 3 years ago

Signing out and restarting worked for me

charithar commented 3 years ago

Purging data as show by @josh9383 worked for me. This behavior started couple of updates back. Until then it worked with WSL fine. Need to see if it pops up again in the next reboot.

stevenobird commented 3 years ago

Since 3.5.x the issue seemed to be gone for me - I did not log out from Docker Hub nor did I purge any data manually.

miyouzi commented 3 years ago

Thus far I've purged data, logged out and back in, reinstalled docker and WSL, and updated docker versions a few times now. Sadly, nothing has yet resolved it. I've gotten to the point where I've just made peace with the new step in my morning procedure. If anyone happens across something new, I'd be appreciative.

Also, still seeing this in the event viewer:

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__4.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.BackendAPIClient+<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()
Faulting application name: Docker Desktop.exe, version: 3.5.1.0, time stamp: 0x8c3f2661
Faulting module name: KERNELBASE.dll, version: 10.0.19041.1081, time stamp: 0xde3fc775
Exception code: 0xe0434352
Fault offset: 0x0000000000034ed9
Faulting process id: 0x5f2c
Faulting application start time: 0x01d76e3ce568ab92
Faulting application path: C:\Program Files\Docker\Docker\Docker Desktop.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 25f84150-b79c-490e-b0c8-3d78744a9c1d
Faulting package full name: 
Faulting package-relative application ID: 

I have the same problem, the event log exactly the same.

I must start Docker Desktop twice after Windows startup.

My Docker Desktop version is 3.5.1

pbois34 commented 3 years ago

In previous version of windows docker desktop i had solved my problem at docker start signing out of dockerhub. But with new version 3.5.1, new problem: it takes a long long time before docker destop is started (at least 10 minutes this morning). Every update there is a new problem, docker is not reliable

EmilyParker24 commented 3 years ago

Mine broke on Friday after windows security update AND docker update 3.5.2. I mainly get timeout errors after 10 minutes but I changed the timeout to an hour and it still never started. I've tried every possible solution and nothing seems to make a dent. I've spent 2 full days on this and don't know what to do anymore.

RawrBear commented 3 years ago

Same problem here. Windows starts, Docker doesn't, no tray icon, nothing. Task manager shows Docker Desktop and Docker.Service running, with Docker Desktop Backend showing up for a fraction of a second ever few minutes. When I run Docker Desktop from the exe or the shortcut (even as Admin, still the same), I instantly get a window popup with "Docker failed to initialize The operation had timed out." without any hanging or anything, just instant popup.

I've tried killing and restarting all the processes I can find, tried uninstall/reinstall, tried downgrading all the way back to 3.5.0, re-installed the Linux package, made sure Virtual Machine Platform and Windows Subsystem for Linux are both checked, checked bios to make sure all virtualizations are enabled.. Everything was working fine yesterday evening, wont work now. I also tried running docker commands from the cli but it says the daemon isn't running. I tried to run it manually but "dockerd" isn't a recognized command. Also tried "DockerCli.exe -SwitchDaemon" and that does nothing. Multiple, shutdowns, reboots and logouts also do nothing. I'm out of ideas at this point.

RawrBear commented 3 years ago

I ran the rest of the Windows updates that came in last night, tried Docker this morning and still the same. I'm gonna have to drop it from my work flow until this gets fixed :(

RawrBear commented 3 years ago

Just found something that worked for me! https://www.reddit.com/r/docker/comments/o0a0oo/docker_failed_to_initialize_help/ All credit goes to: Bao2167

First press windows+r for run

type 'appdata' and press enter

go to both roaming and local (if applicable) and delete anything related to docker

open docker again

For me, as soon as I deleted everything from the Docker Desktop folder, Docker popped up a message saying that the Docker service wasn't running and would I like to start it, I hit yes and docker started up. I haven't tested this with a reboot or anything but so far, so good.

miyouzi commented 3 years ago

@jslow421 The problem disappear today, but actually I don't know why ! My Docker Desktop Version is still 3.5.1

I just edit %USERPROFILE%\.wslconfig upgrade memory setting, now my .wslconfig content is below

[wsl2]
memory=4096MB
swap=0

and turn on Enable integration with additional distros image

veben commented 3 years ago

This solved it for me.

#1825 (comment)

DockerCli.exe -SwitchDaemon

For more information, see: https://stackoverflow.com/a/61062715/8718377

domiwar commented 3 years ago

@stevenobird

Restarting the Docker Desktop.exe and the com.docker.service service fixes this issue - until the next Windows reboot.

could you expand on this? I have restarted the Docker Desktop.exe and also restarted the service with pwsh admin Restart-Service com.docker.service but it doesn't seem to fix the issue for me - though everything else seems exactly as you describe.

That's really the only two steps I do to temporarily fix the issue. I stop Docker Desktop.exe with the Task Manager under "Details" tab and switch to "Services" tab to restart com.docker.service (which should be similar to doing it with Powershell). After that, I manually open up Docker Desktop.exe again and everything boots up as it should.

Hmm, that doesn't seem to work for me but if I go into the troubleshooting part of the docker desktop app and purge hyperv data it forces a restart of the docker service and boots up again, keeping my wsl2 images etc because it's using the WSL2 engine instead.

It could just be me not doing the Windows service restarts right etc, but it's an easier workaround anyway tbh.

Same for me, since an update in windows 10 locked the LxddManager service in manual start e not automatic

ChrML commented 3 years ago

Same issue here. One time the server restarted in June, and Docker failed to start automatically for the reasons mentioned above. Manually starting Docker from services.msc later after restart works.

Another time happened just a few days ago. Same scenario.

sirpeebs commented 3 years ago

I'm new to docker but been fighting this for weeks, quite honestly have never gotten it to run correctly. How is it something is so funded and popular but literally does not work in Windows at all after months of attempts? I ask with sincerity as this is rather perplexing why you all poor so much effort into running something that simply resists - to what benefit?

jacalata commented 3 years ago

Just found something that worked for me! https://www.reddit.com/r/docker/comments/o0a0oo/docker_failed_to_initialize_help/ All credit goes to: Bao2167

First press windows+r for run

type 'appdata' and press enter

go to both roaming and local (if applicable) and delete anything related to docker

Thank you! This worked for me, all the -switchdaemon etc didn't help.

jacalata commented 3 years ago

I'm new to docker but been fighting this for weeks, quite honestly have never gotten it to run correctly. How is it something is so funded and popular but literally does not work in Windows at all after months of attempts? I ask with sincerity as this is rather perplexing why you all poor so much effort into running something that simply resists - to what benefit?

The vast majority of time it just works in Windows. As such, it has become a core part of many workflows and other applications, and so when an individual does run into a problem, they often don't have the option of just not using it.

maniv2013 commented 3 years ago

Below steps resolved for me

  1. Taskbar icons --> Right Click on Docker icon --> Click TroubleShoot from the context menu
  2. Click - Clean/Purge Data button
  3. Select all data sets - Hyper-V, WSL 2, Windows Contaienrs
  4. Wait for cleanup to complete
  5. Quit Docker desktop as : Taskbar icons --> Right Click on Docker icon --> Click Quit
  6. Start Docker desktop again

image

Thanks, @josh9383 The above steps saved me after with windows11 upgrade.

AkshTheGaikwad commented 3 years ago

Below steps resolved for me

  1. Taskbar icons --> Right Click on Docker icon --> Click TroubleShoot from the context menu
  2. Click - Clean/Purge Data button
  3. Select all data sets - Hyper-V, WSL 2, Windows Contaienrs
  4. Wait for cleanup to complete
  5. Quit Docker desktop as : Taskbar icons --> Right Click on Docker icon --> Click Quit
  6. Start Docker desktop again

image

Thanks, @josh9383 The above steps saved me after with windows11 upgrade.

You can go into troubleshoot directly from docker also . When I tried to purge the data it gave a prompt that I have to download and install WSL2 and gave a link where I could download that. as the link was not clickable I typed the same in browser and opened it . It was of Microsoft download page of WSL 2 . I downloaded and installed WSL2 and then reopened docker and was able to purge the data this time . After which I got the docker basic tutorial screen. image

Shr3ps commented 2 years ago

Same problem here. Windows starts, Docker doesn't, no tray icon, nothing. Task manager shows Docker Desktop and Docker.Service running, with Docker Desktop Backend showing up for a fraction of a second ever few minutes. When I run Docker Desktop from the exe or the shortcut (even as Admin, still the same), I instantly get a window popup with "Docker failed to initialize The operation had timed out." without any hanging or anything, just instant popup.

I've tried killing and restarting all the processes I can find, tried uninstall/reinstall, tried downgrading all the way back to 3.5.0, re-installed the Linux package, made sure Virtual Machine Platform and Windows Subsystem for Linux are both checked, checked bios to make sure all virtualizations are enabled.. Everything was working fine yesterday evening, wont work now. I also tried running docker commands from the cli but it says the daemon isn't running. I tried to run it manually but "dockerd" isn't a recognized command. Also tried "DockerCli.exe -SwitchDaemon" and that does nothing. Multiple, shutdowns, reboots and logouts also do nothing. I'm out of ideas at this point.

I got this too with Docker v4.0 & v4.1. I had to rollback/clean install v3.3.0, seems to be the only version working fine on my Windows 10 :'(

herbat73 commented 2 years ago

Here is what helped me with Docker Desktop 4.1.1 (69879) on Windows Pro 10

  1. Make sure you have Instaled WSL 2 backend

Open powershell as administrator Type as command

wsl.exe --install -d Ubuntu

Set Ubuntu version wsdl 2

wsl --set-version Ubuntu 2

Set wsl to as default version 2

wsl --set-default-version 2

  1. Enable VirtualMachinePlatform

Open powershell as administrator Type as command

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

  1. Install Docker Docker Desktop (4.1.1)

  2. Run Docker Desktop and make sure you have dockeker desktop settings

image

  1. Restart
dougbreaux commented 2 years ago

Man, I still never got this to work again, even after complete uninstall/reinstall, including purge data and manually delete AppData. Uninstalled again. Going to Rancher Desktop + nerdctl

davidhoelzel commented 2 years ago

What was working for me, after several re-installs:

  1. Remove Docker Desktop from autostart
  2. (Re-)Boot up Windows
  3. Manually Stop Docker Desktop Service
  4. Optionally connect to your VPN
  5. Manually Start Docker Desktop Service
  6. Start Docker Desktop
  7. Wait for 30(!) Minutes => Docker Desktop is running

Still using Hyper V Backend, wsl2 has too many issues (https://github.com/Microsoft/WSL/issues). More occupied with repairing things in windows than actually developing.

Technical Masterpiece... WSL2 Backend is crappy as hell, alone due to ext4 issues when your are shutting down your PC to fast (not that we have any control over that in Windows). If I were not forced to develop on windows, I never would use this. Oh, wait, this costs money now? What for exactly?

spyro2000 commented 2 years ago

Same here (since half a year or so). Having to restart WSL2 completely which forces docker to restart. Before that I can't communicate with any container.