docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 118 forks source link

Docker is stuck at "Docker is stopping" after waking up from sleep and having "Start Docker Desktop when you log in" enabled. #6546

Open henry-harness opened 1 year ago

henry-harness commented 1 year ago

Expected behavior

When you use the "Start Docker Desktop when you log in" feature, after the computer wakes up from sleep, docker should be resuming normally.

Actual behavior

When the computer is awake from sleep, docker is stuck on "Docker is stopping" state. You cannot get out of this and computer needs to be restarted.

Workaround

Turn off "Start Docker Desktop when you log in" and sleep/wakeup will work as expected

Information

Please, help us understand the problem. For instance:

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

❯ /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0014: are the backend processes running?
[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[FAIL] DD0012: is the VM networking working? network checks failed: failed to ping host: exit status 1
[2022-10-28T20:15:31.081698000Z][com.docker.diagnose][I] ipc.NewClient: 047c71cc-diagnose-network -> diagnosticd.sock diagnosticsd
[common/pkg/diagkit/gather/diagnose.runIsVMNetworkingOK()
[   common/pkg/diagkit/gather/diagnose/network.go:34 +0xc8
[common/pkg/diagkit/gather/diagnose.(*test).GetResult(0x104fa3be0)
[   common/pkg/diagkit/gather/diagnose/test.go:46 +0x40
[common/pkg/diagkit/gather/diagnose.Run.func1(0x104fa3be0)
[   common/pkg/diagkit/gather/diagnose/run.go:17 +0x40
[common/pkg/diagkit/gather/diagnose.walkOnce.func1(0x2?, 0x104fa3be0)
[   common/pkg/diagkit/gather/diagnose/run.go:142 +0x80
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x1, 0x104fa3be0, 0x140007e1718)
[   common/pkg/diagkit/gather/diagnose/run.go:151 +0x88
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x0, 0x104fa3d60, 0x140007e1718)
[   common/pkg/diagkit/gather/diagnose/run.go:148 +0x50
[common/pkg/diagkit/gather/diagnose.walkOnce(0x104a61a60?, 0x140003df890)
[   common/pkg/diagkit/gather/diagnose/run.go:137 +0x8c
[common/pkg/diagkit/gather/diagnose.Run(0x104fa3d60, 0x1400042cf80?, {0x140003dfb08, 0x1, 0x1})
[   common/pkg/diagkit/gather/diagnose/run.go:16 +0x160
[main.checkCmd({0x140001b6010?, 0x6?, 0x4?}, {0x0, 0x0})
[   common/cmd/com.docker.diagnose/main.go:133 +0xdc
[main.main()
[   common/cmd/com.docker.diagnose/main.go:99 +0x30c
[2022-10-28T20:15:31.082322000Z][com.docker.diagnose][I] (71e67ab1) 047c71cc-diagnose-network C->S diagnosticsd POST /check-network-connectivity: {"ips":["192.168.50.165","192.168.149.13"]}
[2022-10-28T20:15:31.621928000Z][com.docker.diagnose][W] (71e67ab1) 047c71cc-diagnose-network C<-S a661e118-diagnosticsd POST /check-network-connectivity (539.674ms): failed to ping host: exit status 1

[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0032: do Docker networks overlap with host IPs?

Please investigate the following 1 issue:

1 : The test: is the VM networking working?
    Failed with: network checks failed: failed to ping host: exit status 1

VM seems to have a network connectivity issue. Check your host firewall and anti-virus settings in case they are blocking the VM.

Steps to reproduce the behavior

  1. Enable "Start Docker Desktop when you log in" in docker desktop
  2. use as normal
  3. Go to apple menu, click on sleep
  4. Come back next morning and wake the computer
  5. Login, and docker desktop is stuck at "Docker is stopping"
  6. Cannot quit or restart docker
  7. Need to restart laptop
Niko-La commented 10 months ago

Is it solved now ? Can we finally update ? Or are you guys using podman instead ?

fennb commented 10 months ago

Is it solved now ? Can we finally update ? Or are you guys using podman instead ?

From all of my experience (and seemingly those above) this is now solved (and IMO this issue should be closed). To be clear, it is safe to upgrade to the latest version of Docker for Mac and not suffer this particular issue.

That's not to say there's not other similar issues, but they are unrelated to this one as it stands from my experience.

schwemmer commented 8 months ago

I have this exact same issue on Intel Mac with MacOS Ventura 13.6.4 with the latest Docker 4.27.0. No issues on the M1 Macbook Pro.

clecap commented 3 months ago

Same problem here with 4.31.0 on MacOS Monterex 12. 7. 4 on MacPro (Late 2013).

Workaround Turn off "Start Docker Desktop when you log in" and sleep/wakeup will work as expected does not work.

My workaround is to quit and restart docker desktop after every sleep. Annoying.

ferminmoli commented 3 months ago

Hi! Having the same issue on sonoma 14.5