for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Docker for Mac is stucked at starting

Open WillyReyno opened this issue 3 years ago • 29 comments

  • [x] I have tried with the latest version of Docker Desktop
  • [ ] I have tried disabling enabled experimental features => I can't reach the Experimental Features tab to check if they are enabled or not. On the "Settings" menu I reach the "General" tab but can't move to another menu due to the loading icon / gray overlay.
  • [x] I have uploaded Diagnostics

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.

  • macOS Version: 12.1
  • Intel chip or Apple chip: Apple M1 Pro
  • Docker Desktop Version: 4.4.2

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.

WillyReyno avatar Jan 16 '22 09:01 WillyReyno

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

  • macOS Monterey version 12.1
  • Intel i9 chip
  • Docker Desktop for Mac version 4.4.2

georgeharley avatar Jan 16 '22 16:01 georgeharley

Also have the same issue. :/

  • macOS Monterey version 12.1
  • Intel i5 chip
  • Docker Desktop for Mac version 4.4.2

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

martinezleoml avatar Jan 17 '22 09:01 martinezleoml

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. :/

martinezleoml avatar Jan 17 '22 09:01 martinezleoml

@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 avatar Jan 18 '22 11:01 fredericdalleau

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

fredericdalleau avatar Jan 18 '22 11:01 fredericdalleau

@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

WillyReyno avatar Jan 18 '22 11:01 WillyReyno

@WillyReyno good to hear it's working now !

fredericdalleau avatar Jan 18 '22 11:01 fredericdalleau

@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 😊

georgeharley avatar Jan 18 '22 13:01 georgeharley

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

Daisuke-sama avatar Feb 06 '22 23:02 Daisuke-sama

@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.

AmirMustafa avatar Feb 12 '22 02:02 AmirMustafa

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.

iranicus avatar Feb 17 '22 16:02 iranicus

AmirMustafa

WORKED! THANK YOU

mikebolivar avatar Apr 22 '22 12:04 mikebolivar

AmirMustafa

WORKED! THANK YOU

Glad it helped Mike :)

AmirMustafa avatar Apr 23 '22 16:04 AmirMustafa

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.

KotieSmit avatar Jun 07 '22 17:06 KotieSmit

@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

ekson73 avatar Jun 10 '22 13:06 ekson73

@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

AmirMustafa avatar Jun 10 '22 13:06 AmirMustafa

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

docker-robott avatar Sep 08 '22 01:09 docker-robott

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

MichalDanielDobrzanski avatar Sep 25 '22 20:09 MichalDanielDobrzanski

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.

dmoles avatar Nov 18 '22 21:11 dmoles

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

Sebsebzen avatar Dec 19 '22 13:12 Sebsebzen

Thanks. Also works for me on Ventura 13.0.1

AlexanderSutul avatar Jan 02 '23 20:01 AlexanderSutul

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.

Nadohs avatar Jan 09 '23 19:01 Nadohs

@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 .

gpongelli avatar Jan 14 '23 13:01 gpongelli

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

anitejngo avatar Jan 26 '23 12:01 anitejngo

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 

davidmoshal avatar Jan 27 '23 19:01 davidmoshal

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)

purpleladydragons avatar Jan 28 '23 00:01 purpleladydragons

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

robertoandrade avatar Jun 03 '23 13:06 robertoandrade

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!

PiTiLeZarD avatar Oct 23 '23 00:10 PiTiLeZarD

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.

adammartin-mednax avatar Nov 07 '23 13:11 adammartin-mednax

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!

Thank you! You saved my life 🙏

salmagomaa avatar Aug 05 '24 17:08 salmagomaa