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.)
abrueck commented 3 years ago

I habe the same problem, since some days:

The first days restarting the com.docker.service service fixes this issue. But now I must go to the Troubleshooting menu in Docker Desktop an "Clean / Purge data" for WSL2. After that, Docker works again, but only until the next restart.

I tried to reinstall WSL2 and also turn off fast startup in Windows, but this does not solve the problem.

The output of "wsl -l -v" after a restart is:

  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop-data    Stopped         2
  docker-desktop         Stopped         2

The docker icon in the taskbar not showing "the small container".

jsomhorst commented 3 years ago

Same here

Windows Version: Windows 10 Pro 10.0.19041 Build 19041 Docker Desktop Version: 3.3.1 WSL2 or Hyper-V backend: WSL 2 based engine Are you running inside a virtualized Windows e.g. on a cloud server or a VM: No

Similar to Abrueck. When I clean/purge data the WSL2 engine starts and everything seems to work again.

rbalaine commented 3 years ago

Same thing for me since 3.3.1 using Hyper-V. Cleaning data also solve the issue.

Here is my Diagnostics ID if it can help: 1D7DFA7F-F9AD-4393-9DEE-920993A35CC7/20210420110952

CPTechnikVX commented 3 years ago

I had the same problems with 3.3.1 using WSL2.

Downgrading to 3.2.2, Reset to factory defaults and updating to 3.3.1 fixed it for me.

chlillelund commented 3 years ago

@CPTechnikVX Is it fixed permanently? The same procedure worked for me, but only until I rebooted the computer. Now, when I try to start Docker it hangs again. I then have to go back and reset to factory or purge, before I can start Docker

CPTechnikVX commented 3 years ago

@CPTechnikVX Is it fixed permanently? The same procedure worked for me, but only until I rebooted the computer. Now, when I try to start Docker it hangs again. I then have to go back and reset to factory or purge, before I can start Docker

@chlillelund Unfortunately, I have the same behaviour. After a reboot it's broken again and I can't reach "Troubleshoot" anymore :-( But that happened only after I started using kubernetes again. No idea if there is a connection.

MSaracusti commented 3 years ago

It seems to be an issue with WSL2. I had to disable from Windows Features, uninstall docker, restart, install docker again but at the moment it asks to deploy WSL2 I unchecked this and it worked. So I can confirm there is an issue with WSL2 and docker desktop for Windows. Do you know guys who should to report this bug?

stevenobird commented 3 years ago

@MSaracusti my bet would be this repo: https://github.com/microsoft/WSL/issues

CPTechnikVX commented 3 years ago

I tried adding the following lines to my .wslconfig file

[wsl2]
guiapplications=false

but Docker started successfully only once. I don't think the changes made it work once. The proposal does not seem to solve my problem.

CPTechnikVX commented 3 years ago

I am one step further. I found out that Docker only starts for me when I am connected to the company via VPN (domain controller?). I have disabled autostart, connect via VPN first after login and then start Docker. With version 3.2.x it still ran without VPN. No idea if that helps narrow down the cause.

12trey commented 3 years ago

This solved it for me.

https://github.com/docker/for-win/issues/1825#issuecomment-433719346

DockerCli.exe -SwitchDaemon

flopes89 commented 3 years ago

Same issue for me, even downgrading to 3.3.0 didn't help. Even if Docker Desktop starts up, at some point after that it will lose the connection somehow and is not able to restore it. I then have to purge all data and redeploy all containers and hope they work as expected. (all HpyerV Backend, no WSL whatsoever)

Diagnostic ID 9128567D-5F64-415B-AEC3-AC20E97D3825/20210422134148

Also; when this happens and I run docker container ls e.g. from CMD it shows Error reponse from Daemon: i/o timeout

I found the following line in the log which confuses me. I have neither WSL2 installed nor have I checked the "use WSL2" checkbox in docker.

Why is it trying to use it?

[15:49:36.484][GoBackendProcess  ][Info   ] GET failed with Get "http://unix/forwards/list": open \\.\pipe\dockerWsl2BootstrapExposePorts: Das System kann die angegebene Datei nicht finden.

Edit; I got it running after some purges and what I noticed is in the log the following lines are just repeating every couple of seconds. As I said, I don't use WSL2 and I do not have any VPN connections on the machine.

[16:26:36.658][GoBackendProcess  ][Info   ] GET failed with Get "http://unix/forwards/list": open \\.\pipe\dockerWsl2BootstrapExposePorts: Das System kann die angegebene Datei nicht finden.
[16:26:36.658][GoBackendProcess  ][Info   ] msg="external: GET /forwards/list 200 \"Go-http-client/1.1\" \"\""
[16:26:36.658][ApiProxy          ][Info   ] msg="proxy << GET /v1.40/containers/json?all=true (2.8309ms)\n"
[16:26:36.659][ApiProxy          ][Info   ] msg="proxy >> GET /v1.40/images/json\n"
[16:26:36.659][VpnKitBridge      ][Info   ] msg="error CloseWrite to: Die Pipe wird gerade geschlossen."
[16:26:36.662][ApiProxy          ][Info   ] msg="proxy << GET /v1.40/images/json (1.619ms)\n"
[16:26:36.662][VpnKitBridge      ][Info   ] msg="error CloseWrite to: Die Pipe wird gerade geschlossen."
[16:26:36.670][ApiProxy          ][Info   ] msg="proxy >> GET /v1.40/containers/json?all=true\n"
geokaps commented 3 years ago

I am one step further. I found out that Docker only starts for me when I am connected to the company via VPN (domain controller?). I have disabled autostart, connect via VPN first after login and then start Docker. With version 3.2.x it still ran without VPN. No idea if that helps narrow down the cause.

As @CPTechnikVX indicated above, I too have found that if I connect to my company's VPN first, then Docker Desktop will start and appears to run normally. I can also confirm that version 3.2.x started and ran fine without the VPN being connected. Because I'm not on a team version, when 3.2.x is installed, it is automatically upgraded to 3.3.1 on the next reboot and the problem comes right back.

Also, when not connected to the VPN, the Docker Desktop (3.3.1) Settings Screen has a spinner on it that loads forever.

The support/diagnostics screen is able to load and I was able to register a successful diagnostic. This is in the "broken" mode where I'm not connected to the VPN and docker desktop will not successfully load: Diagnostics ID: D02CCEDE-9F66-403C-8750-365AE8E7959B/20210422135409

Hope this helps.

sassner commented 3 years ago

I'm having the same issue. Version 3.2.2 will start and keep running, but I can't stop it from updating to a higher version. 3.3.0 and higher will only start (even immediately after a complete re-install) after resetting to factory settings. After any restart it fails again. I'm also getting the error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. error from the cli.

From what I can tell there are two background processes that aren't starting: com.docker.proxy.exe and com.docker.wsl-distro-proxy.exe. After resetting to factory defaults these start up and everything works as expected.

Diagnostics Id: 08966A9E-4F41-4FBC-B95C-F3F994876D15/20210422233159

LyleDavis 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.

stevenobird 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.

LyleDavis 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.

stevenobird 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.

And there's my problem: Docker Desktop is unresponsive/hanging so I can't even get to the troubleshooting part. 😅 That's why I take my described steps in the first place.

LyleDavis 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.

And there's my problem: Docker Desktop is unresponsive/hanging so I can't even get to the troubleshooting part. 😅 That's why I take my described steps in the first place.

Ah interesting! For me, the docker desktop settings page hangs and is unresponsive, but I'm able to access the troubleshooting tab! I hope it's fixed soon, I keep on ranting and raving to people at work at how good the WSL2 workflow is instead of virtualbox and then this happens 🤣

stevenobird commented 3 years ago

Ah interesting! For me, the docker desktop settings page hangs and is unresponsive, but I'm able to access the troubleshooting tab! I hope it's fixed soon, I keep on ranting and raving to people at work at how good the WSL2 workflow is instead of virtualbox and then this happens 🤣

Got it working now. Double click on the icon in the taskbar makes it indeed working so I can finally send diagnostics that are in an "unresponsive" state.

Diagnostic ID: CEE7896D-A758-4E58-87F1-61F5D73B9549/20210423174133

veertien commented 3 years ago

What worked for me now (twice) is to sign out of Windows and then sign back in again.

shochdoerfer commented 3 years ago

I seem to have a similar problem. I need to purge all data to make Docker start again and be useable in WSL2 after a reboot. I am using version 3.3.1 of Docker Desktop. I upgraded a few weeks ago to 3.3.1 and had no issues so far. The problem appeared just a few days ago. The only thing that changed recently is, that I installed the KB4023057 Windows update. After that, the problem started to occur.

pbois34 commented 3 years ago

The solution "stop Docker Desktop.exe with the Task Manager under "Details" tab and switch to "Services" tab to restart com.docker.service " works for me, but I also noticed that if I wait several minutes after logging to my PC before starting docker desktop (I disabled automatic start) it works too (but then ,sometimes, docker takes 5 minutes to achieve start. It seemes relatated to com.docker.proxy.exe ) Docker for windows is a good product but at almost every update I encounter problems.

stevenobird commented 3 years ago

My guess it that it might be connected to WSL 2 not being ready when Docker is starting.

nicomollet commented 3 years ago

I don't use WSL2 and Docker still doesn't start since this morning. I tried :

All my local dev is now impossible thanks to the auto updates :( Diagnostics ID: 0DCF30C3-D5BF-430F-A8CE-97345E937964/20210426103636

flopes89 commented 3 years ago

My guess it that it might be connected to WSL 2 not being ready when Docker is starting.

Def not. None of our devs use WSL2 but the issues started appearing nonetheless

sassner commented 3 years ago

I'm having the same issue. Version 3.2.2 will start and keep running, but I can't stop it from updating to a higher version. 3.3.0 and higher will only start (even immediately after a complete re-install) after resetting to factory settings. After any restart it fails again. I'm also getting the error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. error from the cli.

From what I can tell there are two background processes that aren't starting: com.docker.proxy.exe and com.docker.wsl-distro-proxy.exe. After resetting to factory defaults these start up and everything works as expected.

Diagnostics Id: 08966A9E-4F41-4FBC-B95C-F3F994876D15/20210422233159

Running windows 19043.928 Happens using wsl2 backend or linux hyper-v backend for me.

razorblade446 commented 3 years ago

I'm not sure it's related to Windows.

Docker 3.2.X works without any issue (removed internet connection to avoid autoupdate)

Once you go with 3.3.1, it begins to fail, so no, I don't think it's related to WSL2, but with Docker 3.3.1 itself.

Diagnostic ID: 250B1C4E-D98F-4825-9FF2-EF82025FEEDD/20210426152454

stevenobird commented 3 years ago

I'm not sure it's related to Windows.

Docker 3.2.X works without any issue (removed internet connection to avoid autoupdate)

Once you go with 3.3.1, it begins to fail, so no, I don't think it's related to WSL2, but with Docker 3.3.1 itself.

Diagnostic ID: 250B1C4E-D98F-4825-9FF2-EF82025FEEDD/20210426152454

This issue also happened for me when using 3.2.x (but before 3.3 released)

dzmitry-kakaruk-webjet commented 3 years ago

Same here. Windows 10 19042.928 Uninstalled 3.3.1, installed 3.2.2 and works fine.

stevenobird commented 3 years ago

Again, something new that I've discovered: When waiting a few moments (about 1-2 minutes) in the Windows login screen before actually logging in, Docker Desktop seems to start without issues. So my guess is that Docker Desktop has a dependency that is not available immediately after Windows is fully booted - a certain service, I don't know? This has been reproducable for me at least three times until now.

paul-michalik commented 3 years ago

As a temporary solution I have downgraded to 3.2.2 and set 'Docker Desktop Installer' folder to Read Only which seemingly stops Docker Desktop from auto updating, credits here. Since I maintain all my software via Chocolatey auto-updates were never my favorite feature.

shochdoerfer commented 3 years ago

So far when purging data I always selected Hyper-V, WSL2, and Windows containers. I just realized it's enough to purge only Windows containers as this will leave the ones stored in WSL2 available.

MaximoTrinidad commented 3 years ago

Same issue here! uninstall and reinstall multiple times. I got it working once but to see it stall "docker start..." once again. resolution: uninstall Docker 3.3.1 and wait for the next version to resolve the issue with WSL2/Ubuntu-20.04.

I will keep an eye on this thread! :(

ianathompson commented 3 years ago

So glad I reboot this morning. 3.3.1 installed now, and not working. AWESOME! Diagnostics ID: 70AC9888-179D-4053-88ED-781CD6149F0C/20210503075044 Didn't realize that downgrading to 3.2.2 would delete everything. So thankful I didn't backup my ext4.vhdx files before I uninstalled 3.3.1. FML Why am I not using Virtualbox? So dumb.

paul-michalik commented 3 years ago

The combination which appears to work for me is:

  1. Download the installer (3.3.2) and run it manually (as opposed to using chocolatey)
  2. When prompted un-select "install wsl components" and "create link on desktop"
  3. Then, start docker desktop and everything runs as it used to 🤷🏻‍♀️
MaximoTrinidad commented 3 years ago

@paul-michalik

You know... it would be helpful if you could provide the link to get to Docker (3.2.2) installer. Also, can you confirm that it still works after rebooting.

Greatly Appreciated, :)

MaximoTrinidad commented 3 years ago

Ok ... just now 11:23 am, while trying to look for the Docker installer 3.2.2, I downloaded the latest version which is 3.3.2. Of course, I haven't seen any post yet on what are the changes.

So, I will post here if I still have any issue with this newer version. Finger crossed :)

paul-michalik commented 3 years ago

@paul-michalik

You know... it would be helpful if you could provide the link to get to Docker (3.2.2) installer. Also, can you confirm that it still works after rebooting.

Greatly Appreciated, :)

I was using the latest version, i.e. 3.3.2 as of writing this

MaximoTrinidad commented 3 years ago

WOOHOO!! YES!!

After installing Docker version 3.3.2 is working now even after rebooting the system.

DockerOK_2021-05-03_12-23-44

mcacker commented 3 years ago

working for me now too :)

mrmadhat commented 3 years ago

@paul-michalik

You know... it would be helpful if you could provide the link to get to Docker (3.2.2) installer. Also, can you confirm that it still works after rebooting.

Greatly Appreciated, :)

For anyone else wondering: 3.3.2 installer download link is available via release notes

mcacker commented 3 years ago

3.3.2 is also currently the default version to download

laughtonsm commented 3 years ago

I've tried v3.3.2 of Docker Desktop for Windows today without success. Docker doesn't start, only purging data seems to temporarily fix this. After a reboot, back to the same issue. Has anyone got a reliable fix? Also, disabling updates is chargeable feature???

pbois34 commented 3 years ago

No difference for me after update to 3.3.2 (I used docker desktop for Windows 3.3.1). I have to stop Docker Desktop.exe, restart com.docker.service " and start again docker desktop

mrmadhat commented 3 years ago

No difference for me after update to 3.3.2 (I used docker desktop for Windows 3.3.1). I have to stop Docker Desktop.exe, restart com.docker.service " and start again docker desktop

Same for me after starting my machine today

pbois34 commented 3 years ago

I found what was the problem for my docker desktop start. By default docker wanted to sign in to my dockerhub account and for some reason related to my proxy (I sometimes use my compagny vpn sometimes not) it failed . In dashboard I signed out from docker hub and now docker starts

geokaps commented 3 years ago

I can second what @pbois34 wrote. For some strange reason, when I signed out from docker desktop and then rebooted, docker desktop now starts without having to first be connected to the company VPN. Previously, I had to first connect to the company VPN, then start docker desktop.

However, if you sign back in to docker desktop, then reboot, the problem comes right back, and docker desktop won't start unless I'm first connected to the company VPN.

MaximoTrinidad commented 3 years ago

@geokaps & @pbois34 ,

For my, to resolve the issue I decided to start Docker Services manually because there's some kind of delay happening in the background, and as mention by @pbois34 might be due to login to the docker hub.

PatUlm commented 3 years ago

I have updated today to version 3.3.3. But for me the problem as with version 3.3.1 still exists: Docker only starts when I am connected to the company VPN.