docker / for-win

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

Docker Desktop for Windows Having Problems When Trying to Start Up #14250

Open Accustiver opened 3 months ago

Accustiver commented 3 months ago

Description

I have Docker Desktop for Windows set to automatically start in the background a half hour after Windows boots up every morning. I have my PC set to restart every day at 5:15am except for Monday which it's set to restart at 6:15am. This all had been working perfectly fine until like a week or so ago. Now, every morning I get up and check my PC, I see a message stating that Docker failed to install WSL2 Distros and I need to either quit or restart. Here is the exact message I get: deploying WSL2 distributions provisioning docker WSL distros: ensuring main distro is deployed: checking if main distro is up to date: checking main distro bootstrap version: getting main distro bootstrap version: open \wsl$\docker-desktop\etc\wsl_bootstrap_version: The network name cannot be found. When I select restart, Docker will eventually start up just fine with no error messages. This will usually be around 9 or 10am every morning.

Reproduce

I'm not really sure how to reproduce this. I basically described the problem in the description.

Expected behavior

Docker Desktop for Windows should be automatically starting up just fine after Windows starts.

docker version

Client:
 Version:           27.1.1
 API version:       1.46
 Go version:        go1.21.12
 Git commit:        6312585
 Built:             Tue Jul 23 19:57:57 2024
 OS/Arch:           windows/amd64
 Context:           desktop-linux

docker info

Client:
 Version:    27.1.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.34
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.14
    Path:     C:\Program Files\Docker\cli-plugins\docker-desktop.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.25
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.3.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.11.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Diagnostics ID

818BC981-9328-44B4-9F4F-BD8BDF4A53E0/20240810132644

Additional Info

No response

Cloud2Software commented 3 months ago

I don't have the same setup for automatic restarts, but most times when I reboot my machine, like after applying Windows patches, I receive the same error message.

Docker Desktop is configured to start up on login and to open the UI.

My diagnostics ID is 5FAC6241-CE34-485D-A5D4-D2FC895D1618/20240813205920.

One additional thing to note, Docker Desktop on Windows is now asking for Priveleged Helper access every time it starts, this is not normal and is very new behaviour. Once granted it is able to start without issue.

PXL_20240813_211702669

luchsamapparat commented 3 months ago

I have a non-admin user and a shortcut that's configured to run Docker Desktop with admin privileges (so I'm asked to enter admin-user credentials when starting docker). For a few days now I get the same error when starting Docker Desktop this way: "The network name cannot be found."

chandrabhan-singh-1 commented 3 months ago

Facing the similar Issue.

This problem started after the upgradation of Docker Desktop from version 4.32.0 to 4.33.1

I downgraded from 4.33.1 to 4.32 back and everything started to work fine again. Then, Tried again to install 4.33.1 and the problem started again. So, It's clear the new version is causing problems on my windows 11 machine.

Accustiver commented 3 months ago

I have Windows 10 but seems it is the same issue whether its 10 or 11. And also seems like it was the upgrade that caused this problem. Can you downgrade to the older version and then upgrade to whatever the latest version is once the folks at Docker have resolved this issue?

chandrabhan-singh-1 commented 3 months ago

It looks like, This new 4.33.1 version is having conflicts with the WSL.

That's what making our machines' behavior abnormal. Well, I would suggest If anyone is having similar issues then they should downgrade their docker desktop to version 4.32.0

It will resolve the problem for now.

Accustiver commented 3 months ago

If you downgrade, how do you go about doing this? Can you simply run the installer for version 4.32.0 or do you have to uninstall 4.33.1 and then install 4.32.0? If you do this, will all of your settings and containers/images remain or will you have to start all over from scratch again?

chandrabhan-singh-1 commented 3 months ago

Well, I had no important containers or images for now. So, I uninstalled it completely and installed the 4.32 version.

But, yes this process will erase all your containers and images.

There should be some other way to downgrade without loosing all your current data.

I think if you will try to install 4.32 version over existing 4.33.1. It will automatically remove the new version 4.33.1 and install the 4.32 without harming your data.

But, I'm not 100% sure about it. So, please be careful.

Cloud2Software commented 3 months ago

I think I will deal with the need to give elevated permissions and to start Docker Desktop twice after a reboot rather than potentially loose data. It is possible to export the volumes to import again later, but I just don't want to do that work.

Accustiver commented 2 months ago

So I'm pretty sure I solved this problem. After digging through some forums/google searches, I came across several posts about folks using the following command: wsl --unregister docker-desktop They would stop docker desktop, then run this command, then fire docker back up and everything would work fine. So what I decided to do was write a quick little .bat file that could help automate this process. Here is the code I wrote: @echo off wsl --unregister docker-desktop timeout 2 I then set up a task in task scheduler to have this automatically run 20 minutes after windows boots up (I have my computer set to restart daily at 6am). I also have a task to have Docker Desktop automatically start 25 minutes after windows boots up. The reason I did that delayed start is because I was having another issue with docker not starting up if it was set to do so right when windows booted up. That problem seemed to stem from it trying to start before WSL did. One final thing to add is that I also have Docker set to start up with the highest privelages...admin. So long story short, after writing that little .bat file, setting an automated task, and having Docker set to start up with admin privelages, I have had no issues with Docker Desktop starting up. Been going on like 2 weeks now without a problem.

Cloud2Software commented 2 months ago

Interesting work-around for a bug with the Docker Desktop application. I have updated to the latest Docker Desktop version, 4.34.0, and the issue no longer presents itself. This has me hesitant to upgrade to the newest release, 4.34.1, that just came out as I like having Docker startup clean when I login to the computer.

On Tue, Sep 3, 2024 at 4:24 PM Accustiver @.***> wrote:

So I'm pretty sure I solved this problem. After digging through some forums/google searches, I came across several posts about folks using the following command: wsl --unregister docker-desktop They would stop docker desktop, then run this command, then fire docker back up and everything would work fine. So what I decided to do was write a quick little .bat file that could help automate this process. Here is the code I wrote: @echo https://github.com/echo off wsl --unregister docker-desktop timeout 2 I then set up a task in task scheduler to have this automatically run 20 minutes after windows boots up (I have my computer set to restart daily at 6am). I also have a task to have Docker Desktop automatically start 25 minutes after windows boots up. The reason I did that delayed start is because I was having another issue with docker not starting up if it was set to do so right when windows booted up. That problem seemed to stem from it trying to start before WSL did. So long story short, after writing that little .bat file and setting an automated task, I have had no issues with Docker Desktop starting up. Been going on like 2 weeks now without a problem.

— Reply to this email directly, view it on GitHub https://github.com/docker/for-win/issues/14250#issuecomment-2327371805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMYOW6OIMWAVIZGT7IRWAU3ZUYLI3AVCNFSM6AAAAABMJ3LP52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRXGM3TCOBQGU . You are receiving this because you commented.Message ID: @.***>

Accustiver commented 2 months ago

I upgraded to the latest release which is 4.34.1 and I turned off that special script I wrote and now Docker starts up just fine after every reboot of the PC. So knock on wood it seems the problem was fixed with this latest update.