docker / for-win

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

Docker Desktop for Windows fails to start with WSL2 backend (starting nfs-common: exit status 1) #13462

Open AdrianDeWinter opened 1 year ago

AdrianDeWinter commented 1 year ago

Actual behavior

Docker desktop fails to start and shows the following error message:

System.Exception:
1 error occurred:
    * waiting for docker daemon: failed to start docker engine: dockerd failed to start: fatal: starting nfs-common: exit status 1

   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__10.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 93
--- 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\PR-21718\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__7.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__7.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 108
--- 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.EngineStateMachine.<StartAsync>d__17.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 97
--- 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.Engines.<StartAsync>d__25.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 126

Expected behavior

Information

The issue cropped up a few days ago, coinciding with updating WSL to the latest version. I have tried a factory reset, reinstalling Docker Desktop, uninstalling Docker and WSL2 cleaning any docker related data from AppData and ProgramFiles and reinstalling, and netsh winsock reset suggested on another issue. Uploading the diagnostics took four attempts, each ending in an error stating WSL wasnt responding, however that was fixed by a wsl --shutdown.

wsl --version output:

WSL version: 1.1.3.0
Kernel version: 5.15.90.1
WSLg version: 1.0.49
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.20348.1668

docker context ls seems fine:

NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT                             KUBERNETES ENDPOINT   ORCHESTRATOR
default *           moby                Current DOCKER_HOST based configuration   npipe:////./pipe/docker_engine

desktop-linux       moby                                                          npipe:////./pipe/dockerDesktopLinuxEngine

wsl -l -v --all

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

Output of & "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check

[2023-05-05T07:02:01.100343800Z][com.docker.diagnose.exe][I] set path configuration to OnHost
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[SKIP] DD0002: does the bootloader have virtualization enabled?
[SKIP] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[SKIP] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[SKIP] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[PASS] DD0029: is the WSL 2 Linux filesystem corrupt?
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[FAIL] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
[2023-05-05T07:02:04.043543500Z][com.docker.diagnose.exe][I] ipc.NewClient: cd7d1a28-diagnose -> \\.\pipe\dockerDiagnosticd diagnosticsd
[2023-05-05T07:02:04.044103300Z][com.docker.diagnose.exe][I] (b6c3951b) cd7d1a28-diagnose C->S diagnosticsd GET /ping
[2023-05-05T07:02:04.044640400Z][com.docker.diagnose.exe][W] (b6c3951b) cd7d1a28-diagnose C<-S NoResponse GET /ping (537.1µs): Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.

[FAIL] DD0004: is the Docker engine running? Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:04.045730500Z][com.docker.diagnose.exe][I] ipc.NewClient: 68e16d75-com.docker.diagnose -> \\.\pipe\dockerLifecycleServer VMDockerdAPI
[2023-05-05T07:02:04.045730500Z][com.docker.diagnose.exe][I] (eeb398bd) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /docker
[2023-05-05T07:02:04.046397700Z][com.docker.diagnose.exe][W] (eeb398bd) 68e16d75-com.docker.diagnose C<-S NoResponse GET /docker (667.2µs): Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:04.046947600Z][com.docker.diagnose.exe][I] (eeb398bd-1) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:04.047493000Z][com.docker.diagnose.exe][W] (eeb398bd-1) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (545.4µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:05.049828700Z][com.docker.diagnose.exe][I] (eeb398bd-2) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:05.050555500Z][com.docker.diagnose.exe][W] (eeb398bd-2) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (726.8µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:06.056990200Z][com.docker.diagnose.exe][I] (eeb398bd-3) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:06.058255300Z][com.docker.diagnose.exe][W] (eeb398bd-3) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (735.4µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:07.071784100Z][com.docker.diagnose.exe][I] (eeb398bd-4) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:07.072315500Z][com.docker.diagnose.exe][W] (eeb398bd-4) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (531.4µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:08.084147800Z][com.docker.diagnose.exe][I] (eeb398bd-5) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:08.085128200Z][com.docker.diagnose.exe][W] (eeb398bd-5) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (980.4µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:09.088271200Z][com.docker.diagnose.exe][I] (eeb398bd-6) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:09.089547500Z][com.docker.diagnose.exe][W] (eeb398bd-6) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (746.9µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:10.092219300Z][com.docker.diagnose.exe][I] (eeb398bd-7) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:10.093466400Z][com.docker.diagnose.exe][W] (eeb398bd-7) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (1.1864ms): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-05T07:02:11.097817800Z][com.docker.diagnose.exe][I] (eeb398bd-8) 68e16d75-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-05T07:02:11.098641200Z][com.docker.diagnose.exe][W] (eeb398bd-8) 68e16d75-com.docker.diagnose C<-S NoResponse GET /ping (823.4µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.

[PASS] DD0015: are the binary symlinks installed?
[FAIL] DD0031: does the Docker API work? 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_linux/v1.24/containers/json": open //./pipe/docker_engine_linux: The system cannot find the file specified.
[PASS] DD0013: is the $PATH ok?
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.
[FAIL] DD0003: is the Docker CLI working? exit status 1
[PASS] DD0005: is the user in the docker-users group?
[PASS] DD0038: is the connection to Docker working?
[FAIL] DD0014: are the backend processes running? 3 errors occurred:
        * com.docker.vpnkit.exe is not running
        * com.docker.proxy.exe is not running
        * com.docker.wsl-distro-proxy.exe is not running

[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[FAIL] DD0009: is the vpnkit API responding? open \\.\pipe\dockerVpnKitDiagnostics: The system cannot find the file specified.
[FAIL] DD0010: is the Docker API proxy responding? failed to ping Docker proxy API with error: Get "http://ipc/desktop-diagnostics/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:12.343292300Z][com.docker.diagnose.exe][I] ipc.NewClient: bb8b692a-diagnose -> \\.\pipe\dockerDesktopLinuxEngine Proxy
[2023-05-05T07:02:12.343309700Z][com.docker.diagnose.exe][I] (b2940f1b) bb8b692a-diagnose C->S Proxy GET /desktop-diagnostics/ping
[2023-05-05T07:02:12.344382400Z][com.docker.diagnose.exe][W] (b2940f1b) bb8b692a-diagnose C<-S NoResponse GET /desktop-diagnostics/ping (543.8µs): Get "http://ipc/desktop-diagnostics/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:12.345472200Z][com.docker.diagnose.exe][I] (b2940f1b-1) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:12.346071500Z][com.docker.diagnose.exe][W] (b2940f1b-1) bb8b692a-diagnose C<-S NoResponse GET /ping (599.3µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:13.353700600Z][com.docker.diagnose.exe][I] (b2940f1b-2) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:13.354505800Z][com.docker.diagnose.exe][W] (b2940f1b-2) bb8b692a-diagnose C<-S NoResponse GET /ping (805.2µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:14.364572900Z][com.docker.diagnose.exe][I] (b2940f1b-3) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:14.365570800Z][com.docker.diagnose.exe][W] (b2940f1b-3) bb8b692a-diagnose C<-S NoResponse GET /ping (1.1275ms): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:15.369516200Z][com.docker.diagnose.exe][I] (b2940f1b-4) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:15.370438700Z][com.docker.diagnose.exe][W] (b2940f1b-4) bb8b692a-diagnose C<-S NoResponse GET /ping (954.2µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:16.385205900Z][com.docker.diagnose.exe][I] (b2940f1b-5) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:16.385876200Z][com.docker.diagnose.exe][W] (b2940f1b-5) bb8b692a-diagnose C<-S NoResponse GET /ping (670.3µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:17.400594500Z][com.docker.diagnose.exe][I] (b2940f1b-6) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:17.400917400Z][com.docker.diagnose.exe][W] (b2940f1b-6) bb8b692a-diagnose C<-S NoResponse GET /ping (322.9µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:18.416287700Z][com.docker.diagnose.exe][I] (b2940f1b-7) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:18.416287700Z][com.docker.diagnose.exe][W] (b2940f1b-7) bb8b692a-diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-05T07:02:19.432002700Z][com.docker.diagnose.exe][I] (b2940f1b-8) bb8b692a-diagnose C->S Proxy GET /ping
[2023-05-05T07:02:19.432002700Z][com.docker.diagnose.exe][W] (b2940f1b-8) bb8b692a-diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.

[SKIP] DD0006: is the Docker Desktop Service responding?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0002: does the bootloader have virtualization enabled?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[PASS] DD0029: is the WSL 2 Linux filesystem corrupt?
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[WARN] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
[WARN] DD0004: is the Docker engine running? Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[PASS] DD0015: are the binary symlinks installed?
[WARN] DD0031: does the Docker API work? 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_linux/v1.24/containers/json": open //./pipe/docker_engine_linux: The system cannot find the file specified.
[WARN] DD0032: do Docker networks overlap with host IPs? 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_linux/v1.24/networks": open //./pipe/docker_engine_linux: The system cannot find the file specified.

Please note the following 4 warnings:

1 : The check: are the LinuxKit services running?
    Produced the following warning: failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.

The Docker engine runs inside a Linux VM as a service. Therefore the services must have started.

2 : The check: is the Docker engine running?
    Produced the following warning: Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.

The Docker engine manages all containers and images on the host. Check the dockerd.log to see why it failed to start.

3 : The check: does the Docker API work?
    Produced the following warning: 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_linux/v1.24/containers/json": open //./pipe/docker_engine_linux: The system cannot find the file specified.

If the Docker API is not available from the host then Docker Desktop will not work correctly.

4 : The check: do Docker networks overlap with host IPs?
    Produced the following warning: 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_linux/v1.24/networks": open //./pipe/docker_engine_linux: The system cannot find the file specified.

If the subnet used by a Docker network overlaps with an IP used by the host, then containers
won't be able to contact the overlapping IP addresses.

Try configuring the IP address range used by networks: in your docker-compose.yml.
See https://docs.docker.com/compose/compose-file/compose-file-v2/#ipv4_address-ipv6_address

Please investigate the following 2 issues:

1 : The test: are the backend processes running?
    Failed with: 3 errors occurred:
        * com.docker.vpnkit.exe is not running
        * com.docker.proxy.exe is not running
        * com.docker.wsl-distro-proxy.exe is not running

Not all of the backend processes are running.

2 : The test: are the LinuxKit services running?
    Failed with: failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.

The Docker engine runs inside a Linux VM as a service. Therefore the services must have started.

Steps to reproduce the behavior

  1. Install Docker Desktop
  2. Launch Docker Desktop
AdrianDeWinter commented 1 year ago

Update: After restoring the docker-desktop-data distro's ext4.vhdx file from an older backup, everything works just fine. As i have made no other changes since yesterday, that seems to indicate that the vhdx file created upon startup was somehow broken.

ctalledo commented 1 year ago

Hi @AdrianDeWinter, thanks for reporting the problem.

Not quite sure why Docker Desktop failed to start. Looking at the logs you uploaded, the first error I see is on 05/05/23 at 01:22:45, indicating that the com.docker.backend program on the host has detected that the dns-forwarder (running inside the WSL distro) terminated unexpectedly:

com.docker.backend.exe.log.5: 2023-05-05T 01:22:45.682537300Z [com.docker.backend.exe][E] dns-forwarder terminated unexpectedly:  2023-05-05T 01:22:45.495072203Z [dns-forwarder][I]  2023-05-05T 01:22:45.494694410Z [dns-forwarder][I] ipc.NewClient: 8ec53b22-dns-forwarder -> /run/host-services/backend.sock backend

Soon after I see this other suspicious log indicating a change in the WSL default distro has been detected:

com.docker.backend.exe.log.5: 2023-05-05T 01:22:46.630258100Z [com.docker.backend.exe][E] handling default distro change: synchronising agents: synchronising agents: synchronising agent list: getting list of distros to integrate with: listing WSL distros: listing WSL distros: context canceled

We've had some issue lately with WSL, particularly around the default distro changing unexpectedly, and I wonder if you are hitting the same problem.

Glad to hear you were able to work-around it by restoring the docker-desktop-data distro ext4.vhdx, though that's less than ideal of course.

YouveGotMeowxy commented 1 year ago

@ctalledo Hi. I eventually got fed up with DD and uninstalled it, then installed Docker natively in my WSL2 ubuntu distro, and still find WAY too many issues with unexpected connectivity drops.

Is there a specific command I can run at that time to test the above 2 things you mentioned? I can't run diagnose.exe since I don't have DD installed.

AdrianDeWinter commented 1 year ago

@ctalledo Thanks four reply. Your theory sounds plausible, and might also fit with difficulty i had getting the diagnostics. Although i don't see how that would go away when restoring the ext4.vhdx file backing docker-desktop-data distro. Then again, if that was preventing the creation of a clean new .vhdx file, i might have just paved over the underlying issue by restoring the old one. I think i will test this and report back.

AdrianDeWinter commented 1 year ago

Alright, i just tested it by shutting down WSL and renaming the intact ext4.vhdx file. Upon startup, Docker Desktop detected the file as missing and prompted me to unregister the docker-desktop-data distro if the issue persisted. Doing that brought back the same old error message (and also deleted the renamed .vhdx file, that i had left in the same directory):

System.Exception:
1 error occurred:
    * waiting for docker daemon: failed to start docker engine: dockerd failed to start: fatal: starting nfs-common: exit status 1

   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__10.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 93
--- 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\PR-21718\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__7.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__7.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 108
--- 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.EngineStateMachine.<StartAsync>d__17.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 97
--- 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.Engines.<StartAsync>d__25.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 126

For completeness, i also grabbed diagnostics and ran diagnose.exe check.

com.docker.diagnose.exe check output:

[2023-05-06T21:35:34.757347900Z][com.docker.diagnose.exe][I] set path configuration to OnHost
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[SKIP] DD0002: does the bootloader have virtualization enabled?
[SKIP] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[SKIP] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[SKIP] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[FAIL] DD0029: is the WSL 2 Linux filesystem corrupt? [    4.473889] EXT4-fs error (device sdc): ext4_put_super:1188: comm Xwayland: Couldn't clean up the journal
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[FAIL] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
[2023-05-06T21:35:37.747610400Z][com.docker.diagnose.exe][I] ipc.NewClient: 46d6c194-diagnose -> \\.\pipe\dockerDiagnosticd diagnosticsd
[2023-05-06T21:35:37.748164000Z][com.docker.diagnose.exe][I] (93d6e613) 46d6c194-diagnose C->S diagnosticsd GET /ping
[2023-05-06T21:35:37.749236600Z][com.docker.diagnose.exe][W] (93d6e613) 46d6c194-diagnose C<-S NoResponse GET /ping (566.2µs): Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.

[FAIL] DD0004: is the Docker engine running? Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:37.749815200Z][com.docker.diagnose.exe][I] ipc.NewClient: df766092-com.docker.diagnose -> \\.\pipe\dockerLifecycleServer VMDockerdAPI
[2023-05-06T21:35:37.750353000Z][com.docker.diagnose.exe][I] (b1075f74) df766092-com.docker.diagnose C->S VMDockerdAPI GET /docker
[2023-05-06T21:35:37.750891700Z][com.docker.diagnose.exe][W] (b1075f74) df766092-com.docker.diagnose C<-S NoResponse GET /docker (538.7µs): Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:37.751430100Z][com.docker.diagnose.exe][I] (b1075f74-1) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:37.751945500Z][com.docker.diagnose.exe][W] (b1075f74-1) df766092-com.docker.diagnose C<-S NoResponse GET /ping (508µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:38.760084600Z][com.docker.diagnose.exe][I] (b1075f74-2) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:38.761481600Z][com.docker.diagnose.exe][W] (b1075f74-2) df766092-com.docker.diagnose C<-S NoResponse GET /ping (1.397ms): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:39.773978100Z][com.docker.diagnose.exe][I] (b1075f74-3) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:39.773978100Z][com.docker.diagnose.exe][W] (b1075f74-3) df766092-com.docker.diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:40.775864200Z][com.docker.diagnose.exe][I] (b1075f74-4) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:40.776028700Z][com.docker.diagnose.exe][W] (b1075f74-4) df766092-com.docker.diagnose C<-S NoResponse GET /ping (164.5µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:41.787428300Z][com.docker.diagnose.exe][I] (b1075f74-5) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:41.787428300Z][com.docker.diagnose.exe][W] (b1075f74-5) df766092-com.docker.diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:42.791231200Z][com.docker.diagnose.exe][I] (b1075f74-6) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:42.791231200Z][com.docker.diagnose.exe][W] (b1075f74-6) df766092-com.docker.diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:43.791524300Z][com.docker.diagnose.exe][I] (b1075f74-7) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:43.791524300Z][com.docker.diagnose.exe][W] (b1075f74-7) df766092-com.docker.diagnose C<-S NoResponse GET /ping (254.1µs): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2023-05-06T21:35:44.807003400Z][com.docker.diagnose.exe][I] (b1075f74-8) df766092-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-05-06T21:35:44.807003400Z][com.docker.diagnose.exe][W] (b1075f74-8) df766092-com.docker.diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.

[PASS] DD0015: are the binary symlinks installed?
[FAIL] DD0031: does the Docker API work? 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_linux/v1.24/containers/json": open //./pipe/docker_engine_linux: The system cannot find the file specified.
[PASS] DD0013: is the $PATH ok?
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.
[FAIL] DD0003: is the Docker CLI working? exit status 1
[PASS] DD0005: is the user in the docker-users group?
[PASS] DD0038: is the connection to Docker working?
[FAIL] DD0014: are the backend processes running? 2 errors occurred:
        * com.docker.proxy.exe is not running
        * com.docker.vpnkit.exe is not running

[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[FAIL] DD0009: is the vpnkit API responding? open \\.\pipe\dockerVpnKitDiagnostics: The system cannot find the file specified.
[FAIL] DD0010: is the Docker API proxy responding? failed to ping Docker proxy API with error: Get "http://ipc/desktop-diagnostics/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:46.282016800Z][com.docker.diagnose.exe][I] ipc.NewClient: 8c88a1d6-diagnose -> \\.\pipe\dockerDesktopLinuxEngine Proxy
[2023-05-06T21:35:46.282547900Z][com.docker.diagnose.exe][I] (41cb3d30) 8c88a1d6-diagnose C->S Proxy GET /desktop-diagnostics/ping
[2023-05-06T21:35:46.283071800Z][com.docker.diagnose.exe][W] (41cb3d30) 8c88a1d6-diagnose C<-S NoResponse GET /desktop-diagnostics/ping (523.9µs): Get "http://ipc/desktop-diagnostics/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:46.283595600Z][com.docker.diagnose.exe][I] (41cb3d30-1) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:46.284122200Z][com.docker.diagnose.exe][W] (41cb3d30-1) 8c88a1d6-diagnose C<-S NoResponse GET /ping (526.6µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:47.291229200Z][com.docker.diagnose.exe][I] (41cb3d30-2) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:47.293617300Z][com.docker.diagnose.exe][W] (41cb3d30-2) 8c88a1d6-diagnose C<-S NoResponse GET /ping (2.3881ms): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:48.307015600Z][com.docker.diagnose.exe][I] (41cb3d30-3) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:48.308125000Z][com.docker.diagnose.exe][W] (41cb3d30-3) 8c88a1d6-diagnose C<-S NoResponse GET /ping (1.1094ms): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:49.322709800Z][com.docker.diagnose.exe][I] (41cb3d30-4) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:49.324784200Z][com.docker.diagnose.exe][W] (41cb3d30-4) 8c88a1d6-diagnose C<-S NoResponse GET /ping (2.0744ms): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:50.338390900Z][com.docker.diagnose.exe][I] (41cb3d30-5) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:50.339127400Z][com.docker.diagnose.exe][W] (41cb3d30-5) 8c88a1d6-diagnose C<-S NoResponse GET /ping (736.5µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:51.341127100Z][com.docker.diagnose.exe][I] (41cb3d30-6) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:51.341400800Z][com.docker.diagnose.exe][W] (41cb3d30-6) 8c88a1d6-diagnose C<-S NoResponse GET /ping (273.7µs): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:52.353871900Z][com.docker.diagnose.exe][I] (41cb3d30-7) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:52.353871900Z][com.docker.diagnose.exe][W] (41cb3d30-7) 8c88a1d6-diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[2023-05-06T21:35:53.369450400Z][com.docker.diagnose.exe][I] (41cb3d30-8) 8c88a1d6-diagnose C->S Proxy GET /ping
[2023-05-06T21:35:53.369450400Z][com.docker.diagnose.exe][W] (41cb3d30-8) 8c88a1d6-diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.

[SKIP] DD0006: is the Docker Desktop Service responding?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0002: does the bootloader have virtualization enabled?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0024: is WSL installed?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[WARN] DD0029: is the WSL 2 Linux filesystem corrupt? [    4.473889] EXT4-fs error (device sdc): ext4_put_super:1188: comm Xwayland: Couldn't clean up the journal
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[WARN] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
[WARN] DD0004: is the Docker engine running? Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[PASS] DD0015: are the binary symlinks installed?
[WARN] DD0031: does the Docker API work? 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_linux/v1.24/containers/json": open //./pipe/docker_engine_linux: The system cannot find the file specified.
[WARN] DD0032: do Docker networks overlap with host IPs? 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_linux/v1.24/networks": open //./pipe/docker_engine_linux: The system cannot find the file specified.

Please note the following 5 warnings:

1 : The check: is the WSL 2 Linux filesystem corrupt?
    Produced the following warning: [    4.473889] EXT4-fs error (device sdc): ext4_put_super:1188: comm Xwayland: Couldn't clean up the journal

If the WSL 2 Linux filesystem is corrupt then Docker Desktop cannot start.
There is a known issue fixed in Windows Insider builds which can cause filesystem corruption, see:
https://github.com/microsoft/WSL/issues/5895 .

Try running "wsl --shutdown" to stop your WSL Virtual Machine. When it restarts it will
run a filesystem check and hopefully fix the problem.

2 : The check: are the LinuxKit services running?
    Produced the following warning: failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.

The Docker engine runs inside a Linux VM as a service. Therefore the services must have started.

3 : The check: is the Docker engine running?
    Produced the following warning: Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.

The Docker engine manages all containers and images on the host. Check the dockerd.log to see why it failed to start.

4 : The check: does the Docker API work?
    Produced the following warning: 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_linux/v1.24/containers/json": open //./pipe/docker_engine_linux: The system cannot find the file specified.

If the Docker API is not available from the host then Docker Desktop will not work correctly.

5 : The check: do Docker networks overlap with host IPs?
    Produced the following warning: 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_linux/v1.24/networks": open //./pipe/docker_engine_linux: The system cannot find the file specified.

If the subnet used by a Docker network overlaps with an IP used by the host, then containers
won't be able to contact the overlapping IP addresses.

Try configuring the IP address range used by networks: in your docker-compose.yml.
See https://docs.docker.com/compose/compose-file/compose-file-v2/#ipv4_address-ipv6_address

Please investigate the following 1 issue:

1 : The test: is the WSL 2 Linux filesystem corrupt?
    Failed with: [    4.473889] EXT4-fs error (device sdc): ext4_put_super:1188: comm Xwayland: Couldn't clean up the journal

If the WSL 2 Linux filesystem is corrupt then Docker Desktop cannot start.
There is a known issue fixed in Windows Insider builds which can cause filesystem corruption, see:
https://github.com/microsoft/WSL/issues/5895 .

Try running "wsl --shutdown" to stop your WSL Virtual Machine. When it restarts it will
run a filesystem check and hopefully fix the problem.

I also tried the same procedure on an up to date Windows 10. There, docker successfully recreated the .vhdx file and started up. I did notice that this time, the newly created file was only ~77mb, versus the 1.5gb of the one the Docker instance on the server kept creating.

wsl --version output on the Win10 machine:

WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2846
ctalledo commented 1 year ago

@ctalledo Hi. I eventually got fed up with DD and uninstalled it, then installed Docker natively in my WSL2 ubuntu distro, and still find WAY too many issues with unexpected connectivity drops.

Hi @YouveGotMeowxy, can you provide an example of the error you see when the connectivity drops? It's a different issue than this current one, but it will help me direct your question to the right place.

YouveGotMeowxy commented 1 year ago

@ctalledo Hi, I don't really see any errors in logs that help lead me in any direction, that's why I was asking if you had any commands you could share that might help me see some errors, or anything.

ctalledo commented 1 year ago

Hi @YouveGotMeowxy, I would start by looking into the Docker Engine logs inside your WSL distro. The location of those logs depends on how you started Docker Engine inside the WSL.

But since it's a different issue than this current one, I would encourage you to open a separate issue for it and describe the connectivity drops as much as possible (when they occur, what containers you are running, etc.) and post anything related you find in the Docker Engine logs inside the WSL distro.

Thanks.

yuanyi-wang commented 1 year ago

Hi @YouveGotMeowxy did you install NFS services in your windows 2022? I got same issue when I isntall NFS services and it works fine now after I removed NFS services.

AdrianDeWinter commented 1 year ago

When i recreated the issue as mentioned above, i did so in a rather permanent fashion. Cleaning the files an reinstalling no longer helped (except once or twice it did?), but importing the vhdx file would brick it again. After over a dozen reinstalls, i finally went the risky route and manually cleaned the registry of anything docker-related after uninstalling docker desktop. That actually fixed the issue, and so far, permanently. I have been running that for a few weeks now, and gone through one or two updates as well.

Unfortunately, i did not back up the keys i deleted so i can't provide them to you, but bit of info maybe this still helps

YouveGotMeowxy commented 1 year ago

Hi @YouveGotMeowxy did you install NFS services in your windows 2022? I got same issue when I isntall NFS services and it works fine now after I removed NFS services.

HI, sorry, I just saw this. I'm running Windows 10; do you mean this?:

image

I've already had it off.