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
firecall commented 1 year ago

Adding my upvote to this issue.

I assumed it was a macOS Ventura 13.0 issue, as I upgraded on release and Docker has been problematic ever since!

ghost commented 1 year ago

Same Issue for me. After sleep and coming back to docker and it got stuck in stopping animation. MacOS Monterey 12.6.1 (Intel i7). Docker Desktop 4.13.0 (89412) Docker Engine v20.10.20

No commads even docker --version won't work.

image

Solution 1 Open "Activity monitor" Search "docker" Stop all docker related processes Reopen Docker or start the docker.

Solution 2 Restarting Laptop.

jansenderr commented 1 year ago

Having the same issue after updating to Ventura. Sleep causes the app to break and give perma "startup/teardown" animation in the taskbar.

Can confirm fix of killing all docker processes in Activity Monitor

firecall commented 1 year ago

I'm not convinced it's related to macOS sleeping.

I'm now running Amphetamine to try and ensure the Mac Mini server never sleeps.

However I'm still seeing the same problem where Docker Desktop shows "Docker is Stopping"

I've completely blown away all and anything thing to do with Docker Desktop, then re-downloaded and set-up a fresh copy. But the problem persists!

So either Amphetamine isn't preventing 'sleep' or it's something else!

I updated this morning to 4.13.1 (90346), so I'll see if that fixes anything!

EDIT: Still getting the Stopping issue with 4.13.1 :-(

henry-harness commented 1 year ago

@firecall Funny that you say that, cause I have the option "Start Docker Desktop when you log in" disabled, and this morning after wake up, i am getting the "Docker is stopping".

Niko-La commented 1 year ago

pkill docker same as killing all docker process using activity moniter? it seems to work for me to get it back up without restarting. I do have to wait about 15 sec before restarting docker desktop

  1. what are steps to take to prevent mac m1 mini from sleeping? i turned off sleep setting yet still docker desktop crashing
  2. what are some docker daemon , desktop health monitoring tools to use to see when it crashed? I use portainer but that is running on container itself.

docker desktop 4.13.1

benasher44 commented 1 year ago

Downgrading to 4.12.0 seems to fix the issue.

firecall commented 1 year ago

Downgrading to 4.12.0 seems to fix the issue.

Same for me.

Downgrade to 4.12.0 and zero issues.

ghost commented 1 year ago

I'm having the same problem after a sleep state. The only way to kill the "in progress" restart from a sleep state is to force kill the "Docker Desktop" process either from the command line or Activity monitor. Going back to 4.12 (again).

Monterey 12.6.1 (MBP 2015).

ties-s commented 1 year ago

Same issue on macOS 12.6, even with Docker Desktop 4.14. Docker is stopping when waking from sleep after some hours.

victoronto commented 1 year ago

Same issue on macOS 13.0.1 with Intel chip, with Docker Desktop 4.14.1 (91661) Downgrade Docker Desktop to 4.12.0 (85629) seems solved the problem.

JasonLamv-t commented 1 year ago

Same issue on Monterey M1 and Hacmini(Inter NUC with i7 8Gen)

DrJohnM61 commented 1 year ago

I also had no issues with my M1 Mac Mini until a month ago or so but now find after a few days, that my docker desktop is stopped. I suspect that it is the same 4.14 upgrade as others have said that they no longer have the issue downgrading to 4.12

Can someone point me in the direction to downgrade to 4.12?

For those asking how to stop your mac going to sleep.. In Ventura... --> "System Settings" and search for "display energy" and select the result "display energy setting... display" and toggle ON the bottom field "Prevent automatic sleeping when display is off"

JasonLamv-t commented 1 year ago

@DrJohnM61 Here is it: https://docs.docker.com/desktop/release-notes/#4120

DrJohnM61 commented 1 year ago

@JasonLamv-t Thank you for providing the link. A lot simpler than I had thought.

jamoralp commented 1 year ago

Thank you for the downgrading suggestion. This has been driving us crazy for the last week. Hopefully it can be sorted out soon.

DrJohnM61 commented 1 year ago

Point to note on downgrading - turn off auto update in system preferences!

lchrennew commented 1 year ago

Same issue on MBP i9 & Mac Studio M1 Max

DrJohnM61 commented 1 year ago

Same issue on MBP i9 & Mac Studio M1 Max

Downgrading to 4.12 has fixed the problem for me. In fact, no issues with 4.12 and forgot to disable the auto upgrade. Worked fine under 4.12 and then auto upgraded and failed again. Downgraded and no issues since. BTW, my M1 does not go to sleep, so I do not think that this is a sleep related issue.

thydian commented 1 year ago

This issue caught me off guard as well. Downgrading to 4.12 (and disabling auto update) has been my workaround as well. MacBook Pro M1 Pro Ventura 13.0.1.

anildigital commented 1 year ago

Same issue here, Apple MacBook Pro (M1 Pro), Ventura (13.1). To fix it, I have to force quit Docker Desktop for Mac and kill docker (ps aux | grep Docker) related processes and then start Docker Desktop for Mac.

chrimblechrumble commented 1 year ago

Same here, Mac M1 Pro, Ventura 13.1, but downgrading to 4.12 does not fix it ☹️

fennb commented 1 year ago

Same here, Macbook Air M2, Monterey, 12.6.2 (21G320. Only working fix I've found so far is downgrading.

fennb commented 1 year ago

I'm not convinced it's related to macOS sleeping.

I'm now running Amphetamine to try and ensure the Mac Mini server never sleeps.

However I'm still seeing the same problem where Docker Desktop shows "Docker is Stopping"

Just adding to this point, I can confirm that this issue isn't 1:1 correlated to sleep. Today my docker is running totally normally after my machine sleeping overnight, so it is, at best, intermittent (the most fun of all kinds of issues).

DrJohnM61 commented 1 year ago

Yes - Agreed. As reported above, I do not let my M1 mini sleep and it happens regardless. Fixed by downgrading version and turning off auto updates.

I'm not convinced it's related to macOS sleeping.

I'm now running Amphetamine to try and ensure the Mac Mini server never sleeps.

However I'm still seeing the same problem where Docker Desktop shows "Docker is Stopping"

Just adding to this point, I can confirm that this issue isn't 1:1 correlated to sleep. Today my docker is running totally normally after my machine sleeping overnight, so it is, at best, intermittent (the most fun of all kinds of issues).

spachner commented 1 year ago

Can also confirm that after downgrading to 4.12.0 the stability problems are gone. Using a Intel MBP with MacOS 13.0.1

regards

spachner

firecall commented 1 year ago

Any words from the Devs on this?

fennb commented 1 year ago

In the spirit of attempting to provide some more information, here's logs for the state my system was/is in at time of Docker crashing/failing: https://gist.githubusercontent.com/fennb/6dc22ebfd4c4ad806af8fb46b7c9fb9d/raw/29ca8b049a20dbfc59a7cc81d80b8521bd2b1553/docker_vpnkit.logs

In this case, I suspect it was related to machine sleep (hard to know as per my comments above) so there presumably may not be any logs of it catching it "in the act", but hopefully the logs are somewhat useful in diagnosing the state of the system.

Happy to perform more detailed diagnosis if one of the devs wants to point me in the right direction.

theskyinflames commented 1 year ago

It has worked to me. Thanks!

pkill docker same as killing all docker process using activity moniter? it seems to work for me to get it back up without restarting. I do have to wait about 15 sec before restarting docker desktop

  1. what are steps to take to prevent mac m1 mini from sleeping? i turned off sleep setting yet still docker desktop crashing
  2. what are some docker daemon , desktop health monitoring tools to use to see when it crashed? I use portainer but that is running on container itself.

docker desktop 4.13.1

jscheel commented 1 year ago

I am having this issue as well. Gonna try disabling the virtualization framework to see if that helps. On v 4.16.2.

denis-tazhkenov commented 1 year ago

The same thing is happening to me. It started around upgrading to 4.13.1. I'm on MacOS 13.0.1. However, I saw this issue happening without the laptop going to sleep.

silentbugs commented 1 year ago

I've had this issue for months. I thought I was running out of RAM so I upgraded from my 16GB MBP to a 32GB MBP. Are there any updates on this?

I know this doesn't help a lot, but you don't need to restart your laptop, you can just kill all docker processes and restart docker.

pkill -f docker

Or if you prefer you can do the same through Activity Monitor.

jscheel commented 1 year ago

This seems to happen randomly when my computer wakes from sleep. It doesn't occur every time though, so it's very difficult to pin down.

yaohwu commented 1 year ago

same happened after upgrading to 4.16.2 (95914) from 4.12

Xypus commented 1 year ago

Definitely not related (or not only related) to sleeping, I just had my Docker Desktop freeze while my machine was up and running. Sleeping freezes it pretty much every time though.

drewlustro commented 1 year ago

This seems to be a huge fire for the devs.

People have reported this problem on multiple issue threads. We discuss for months, then at some point a maintainer comes in and "declares victory" because one person seems to have fixed their setup and locks the thread.

From what I gather, the last stable version was 4.12.x ... everything after that is rough going.

nextflex commented 1 year ago

For me Version 4.12.0 does not work. Same problem - freezing after standby. MacOS 12.6.3 Could it be an issue with the Docker engine rather than the Docker desktop? I think Docker desktop is only a GUI who control the engine by commands. I could also not control the docker by commands. For example "docker -v" does not give an answer after standby.

On which version of Docker Engine does the problem not occur? Get the version number at Docker -> About or in command line "docker -v" Thanks for your help.

denis-tazhkenov commented 1 year ago

It's fixed in 4.17.0.

fharper commented 1 year ago

It's fixed in 4.17.0.

True, I don't have the issue anymore.

kirinse commented 1 year ago

It's fixed in 4.17.0.

Not really. 4.17.0, Monterey (12.6.3) still have same issue.

drewlustro commented 1 year ago

It's fixed in 4.17.0 True, I don't have the issue anymore.

Nope, still experiencing it in 4.17.0 on Ventura 13.2

jscheel commented 1 year ago

I get it 2+ times a day now.

gwimpey commented 1 year ago

Seen on Monterey 12.6.5 Docker 4.18

spachner commented 1 year ago

Had 4.12.0 which was very stable. Updated and got often the issue described here. Gave 4.18.0 a try and do not have any problems since a week (MacOS 13.3.1/2.4 GHz 8-Core Intel Core i9).

spachner

reads21 commented 1 year ago

Still same problem on macbook pro 2017.

yourbuddyconner commented 1 year ago

For any poor souls failing to find a solution to this, this comment helped me out. Guess I had a corrupted container...

https://github.com/docker/for-mac/issues/6499#issuecomment-1263773762

benjamindamm commented 10 months ago

Guys this is still an issue? After such a long time. Are there any news?

benasher44 commented 10 months ago

Doesn't happen for me anymore on latest versions

spachner commented 10 months ago

For me neither, works fine now.

benjamindamm commented 10 months ago

I solved it by not using Docker for my application. It's i/o heavy and obviously Docker + Macos can't handle that. Well it's not really a solution. But I kept the rest of the stack in containers. 🤷🏻‍♂️