docker / for-mac

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

Docker for Mac is stucked at starting #6135

Open WillyReyno opened 2 years ago

WillyReyno commented 2 years ago

Capture d’écran 2022-01-16 à 10 22 37

Expected behavior

Docker for Mac should start as usual.

Actual behavior

Docker for Mac is not starting (even after 10 minutes)

Capture d’écran 2022-01-16 à 10 21 16

Information

I'm not sure if this is reproducible, I got this mac last week and was able to run Docker without issue until yesterday. What I'm sure is that the problem didn't appear after updating docker, it just started out of nowhere. The only thing I remember doing is enabling/disabling new Virtualization framework and use gRPC FUSE for test purposes, it may be what caused my issue.

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

[PASS] DD0027: is there available disk space on the host?
[SKIP] DD0028: is there available VM disk space?
[FAIL] DD0031: does the Docker API work? Cannot connect to the Docker daemon at unix://Library/Containers/com.docker.docker/Data/docker.raw.sock. Is the docker daemon running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[FAIL] DD0016: is the LinuxKit VM running? vm is not running: vm has not started
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[FAIL] DD0017: can a VM be started? vm has not started: vm has not started
[PASS] DD0015: are the binary symlinks installed?
Error response from daemon: dial unix /Users/willy/Library/Containers/com.docker.docker/Data/docker.raw.sock: connect: no such file or directory
[FAIL] DD0003: is the Docker CLI working? exit status 1
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[FAIL] DD0032: do Docker networks overlap with host IPs? Cannot connect to the Docker daemon at unix://Library/Containers/com.docker.docker/Data/docker.raw.sock. Is the docker daemon running?
[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?

Please investigate the following 1 issue:

1 : The test: can a VM be started?
    Failed with: vm has not started: vm has not started

The Docker engine runs inside a Linux VM. Therefore we must be able to start Virtual Machines.

Steps to reproduce the behavior

I can't provide a Dockerfile since it is not a build issue but a software startup one.

I have already try uninstalling, removing all docker related files, but it didn't fix the issue.

georgeharley commented 2 years ago

Seeing the very same tight loop of "Docker Desktop starting..." --> "Docker Desktop stopped..." --> "Docker Desktop starting..." on my Mac immediately after installing the latest Docker Desktop update

martinezleoml commented 2 years ago

Also have the same issue. :/

Diagnostics ID: 9FD9F2F9-AFA6-484B-92D7-D36D693CE118/20220117090712

martinezleoml commented 2 years ago

Hi!

I finally found what was causing Docker to crash (even after uninstalling Docker & removing related Docker VM files).

I added a new path in the File sharing section but that path didn't exist (a folder inside /tmp). After creating that directory, Docker finally started.

It was not easy to troubleshoot because the File sharing section remained unavailable until Docker started up. I had to remember the exactly path I added in file sharing to recover. :/

fredericdalleau commented 2 years ago

@WillyReyno @georgeharley , Could you upload diagnostic informations ? You can refer to : https://docs.docker.com/desktop/mac/troubleshoot/ There is also the possibility to diagnostic from the command line if the UI fails to start. Thanks,

fredericdalleau commented 2 years ago

@martinezleoml Great that you sorted it out, thanks for the diagnostic!

WillyReyno commented 2 years ago

@fredericdalleau Sorry I won't be able to provide a diagnostic since I fixed my issue by rolling back all docker related files to a previous time machine backup which brought me to 4.3.0, then updated back to 4.4.2, and now everything works fine

But I may have done something similar to what @martinezleoml mentionned, it's possible there was a typo in a path I wrote in File Sharing, but I don't remember unfortunately

fredericdalleau commented 2 years ago

@WillyReyno good to hear it's working now !

georgeharley commented 2 years ago

@fredericdalleau Well, this is embarrassing: just opened up the Mac now to try grabbing the requested diagnostic info and Docker starts up fine. Didn't change anything on the machine over the past couple of days, simply rebooted it 😊

Daisuke-sama commented 2 years ago

My Diagnosis with the same problem is here 4F95536C-EE4D-4A37-A2F0-5237A4F96909/20220206224919

https://user-images.githubusercontent.com/16666335/152705437-ad89e0e6-6548-41eb-a942-b1a901a98247.mov

AmirMustafa commented 2 years ago

@Daisuke-sama I was recently facing this issue. In Mac, Docker Desktop was not starting.

Below steps help me fix this issue:

Step1: If Docker Desktop is in an orange colour state (starting state). Open terminal in MAC Screenshot 2022-02-12 at 8 13 44 AM

Step2: Run Below commands in the same order

rm -rf ~/Library/Containers/com.docker.*
cd /usr/local/bin
chmod 0755 dock*

Step3: Restart Docker Desktop, we should wait for a minute we will see in green state (running state) Screenshot 2022-02-12 at 8 14 15 AM

Screenshot 2022-02-12 at 8 14 27 AM

Check detailed steps with screenshots here.

iranicus commented 2 years ago

Mac - Monterey (12.2), 2019 MacBook Pro, Intel Core i7 Docker Desktop 4.5.0

Ran into the same issue earlier today after the mac crashed during a docker compose build, I re-installed docker via homebrew which pulled the current Docker Desktop version 4.5.0. For some reason Docker Desktop still got stuck on starting up (like shown in the screenshot in this ticket) and a couple of minutes later the application stopped altogether and closed. Meanwhile in the background the CPU was being used near 100% so when I checked the Console the following error was being printed out every second:

com.docker.hyperkit - guest: vpnkit-data: error dialing remote endpoint: connection refused

I had to force stop this from running otherwise it keeps running indefinitely and failing which used up a lot of resources making the computer lagging. I was getting this error regardless if I was connected via VPN to the company network or not.

Following the steps posted earlier by AmirMustafa https://github.com/docker/for-mac/issues/6135#issuecomment-1036961549 has fixed the issue now.

mikebolivar commented 2 years ago

AmirMustafa

WORKED! THANK YOU

AmirMustafa commented 2 years ago

AmirMustafa

WORKED! THANK YOU

Glad it helped Mike :)

KotieSmit commented 2 years ago

Intel Mac, Big Sur, Docker desktop 4.9

Tried all or at least most of the solution from above.

The solution for me was that in VirtualBox, there was an "inaccessible image". I removed that, kill all docker processes, restarted docker desktop..... and voila!! Docker is again starting up as per normal.

ekson73 commented 2 years ago

@Daisuke-sama I was recently facing this issue. In Mac, Docker Desktop was not starting.

Below steps help me fix this issue:

Step1: If Docker Desktop is in an orange colour state (starting state). Open terminal in MAC Screenshot 2022-02-12 at 8 13 44 AM

Step2: Run Below commands in the same order

rm -rf ~/Library/Containers/com.docker.*
cd /usr/local/bin
chmod 0755 dock*

Step3: Restart Docker Desktop, we should wait for a minute we will see in green state (running state) Screenshot 2022-02-12 at 8 14 15 AM

Screenshot 2022-02-12 at 8 14 27 AM

Check detailed steps with screenshots here.

That works, thanks

AmirMustafa commented 2 years ago

@Daisuke-sama I was recently facing this issue. In Mac, Docker Desktop was not starting. Below steps help me fix this issue: Step1: If Docker Desktop is in an orange colour state (starting state). Open terminal in MAC Screenshot 2022-02-12 at 8 13 44 AM Step2: Run Below commands in the same order

rm -rf ~/Library/Containers/com.docker.*
cd /usr/local/bin
chmod 0755 dock*

Step3: Restart Docker Desktop, we should wait for a minute we will see in green state (running state) Screenshot 2022-02-12 at 8 14 15 AM Screenshot 2022-02-12 at 8 14 27 AM Check detailed steps with screenshots here.

That works, thanks

Most welcome Ekson

docker-robott commented 1 year ago

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

MichalDanielDobrzanski commented 1 year ago

Did not help. The issue still persists for version 4.12.0 MacOS Monterey 12.5.1

After following the step 2 I got:

Screenshot 2022-09-25 at 22 26 39

/remove-lifecycle stale /lifecycle frozen

dmoles commented 1 year ago

FWIW I got through this by killing /Applications/Docker.app/Contents/MacOS/qemu-system-aarch64 and then relaunching the Docker app (basically I did ps auxww | grep docker and then killed what looked like the most important process). Less destructive than rm -rf ~/Library/Containers/com.docker.* — my containers all still seem to be there after restart.

Sebsebzen commented 1 year ago

If it's due to enabling experimental features or the new Virtualization framework.

Go to ~/Library/Group Containers/group.com.docker/settings.json and manually disable them.

Maybe someone should post a small warning that rm -rf ~/Library/Containers/com.docker.* will delete all your containers

AlexanderSutul commented 1 year ago

Thanks. Also works for me on Ventura 13.0.1

Nadohs commented 1 year ago

Hi!

I finally found what was causing Docker to crash (even after uninstalling Docker & removing related Docker VM files).

I added a new path in the File sharing section but that path didn't exist (a folder inside /tmp). After creating that directory, Docker finally started.

It was not easy to troubleshoot because the File sharing section remained unavailable until Docker started up. I had to remember the exactly path I added in file sharing to recover. :/

I had this same issue, and removed the path from the settings file here in the group container, which remains after uninstall...: ~/Library/Group\ Containers/group.com.docker/settings.json You can just find the path in this file and remove it, then I also killed the com.backend.docker process and restarted docker.

gpongelli commented 1 year ago

@Daisuke-sama I was recently facing this issue. In Mac, Docker Desktop was not starting.

Below steps help me fix this issue:

Step1: If Docker Desktop is in an orange colour state (starting state). Open terminal in MAC Screenshot 2022-02-12 at 8 13 44 AM

Step2: Run Below commands in the same order

rm -rf ~/Library/Containers/com.docker.*
cd /usr/local/bin
chmod 0755 dock*

Step3: Restart Docker Desktop, we should wait for a minute we will see in green state (running state) Screenshot 2022-02-12 at 8 14 15 AM

Screenshot 2022-02-12 at 8 14 27 AM

Check detailed steps with screenshots here.

Thanks! This solved my issue about exit code 152 when starting on Mac osx Ventura and docker desktop 4.15.0 .

anitejngo commented 1 year ago

Had a similar problem... situation was going as following (maybe this will help someone):

Tried to enable virtualization framework But my macOS was below 12.5} Docker left in infinite loop of loading! Had to go into settings file of docker and uncheck use virtualization Updated macOS Enabled virtualization framework Now it all works

davidmoshal commented 1 year ago

This advice helped me: https://forums.docker.com/t/docker-desktop-4-6-1-for-mac-wont-start/122605/14

rm -rf Library/Group\ Containers/group.com.docker
rm -rf Library/Containers/com.docker.docker
rm -rf Library/Application\ Support/Docker\ Desktop 
purpleladydragons commented 1 year ago

Amir's solution did not work for me unfortunately. Following this similar SO answer did the trick (in addition to rming everything, also edit the filesharingDirectories in ~/Library/Group\ Containers/group.com.docker/settings.json)

robertoandrade commented 1 year ago

was able to get it to work again after following the steps I described in my answer to this issue.

PiTiLeZarD commented 8 months ago

rm -rf ~/Library/Containers/com.docker. cd /usr/local/bin chmod 0755 dock

2 days of googling this, tried everything, this was the one that fixed it for me, thanks!

adammartin-mednax commented 8 months ago

One thing I noticed in my case is that i have no files matching dock* in /usr/local/bin

So the solutions provided don't seem to work for me.