docker / for-mac

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

running engine: waiting for the Docker API: context deadline exceeded #7340

Open snowdream opened 5 months ago

snowdream commented 5 months ago

Description

running engine: waiting for the Docker API: context deadline exceeded

Reproduce

1 start the docker desktop for macos

Expected behavior

docker desktop for macos started

docker version

Client:
 Version:           26.1.4
 API version:       1.45
 Go version:        go1.21.11
 Git commit:        5650f9b
 Built:             Wed Jun  5 11:26:02 2024
 OS/Arch:           darwin/amd64
 Context:           desktop-linux
Cannot connect to the Docker daemon at unix:///Users/snowdream/.docker/run/docker.sock. Is the docker daemon running?

docker info

docker info
Client:
 Version:    26.1.4
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.1-desktop.1
    Path:     /Users/snowdream/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1-desktop.1
    Path:     /Users/snowdream/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.32
    Path:     /Users/snowdream/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/snowdream/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.24
    Path:     /Users/snowdream/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/snowdream/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.2.0
    Path:     /Users/snowdream/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/snowdream/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.9.3
    Path:     /Users/snowdream/.docker/cli-plugins/docker-scout

Server:
ERROR: Cannot connect to the Docker daemon at unix:///Users/snowdream/.docker/run/docker.sock. Is the docker daemon running?
errors pretty printing info

Diagnostics ID

F39A3D5A-DFC0-45CF-9F0D-7831FAAC3562/20240625231528

Additional Info

2011719357468_ pic

DuMaM commented 5 months ago

I also got this issue after upgrade. I had to clean up everything inside .docker and uninstall socket_vmnet I dont know which of those steps helped here.

DuMaM commented 5 months ago

Ok I found the issue, adding "insecure-registries" : [ "****", "****" ] to daemon.json makes it unable to start

luisgagocasas commented 4 months ago

It happened to me that I updated docker and when I booted up I got the same message.

I solved it by completely eliminating docker, here are the steps I followed to solve the problem.

Click Go > Go to Folder and navigate to the following folders. ~/Library/Application Support/Docker Desktop/ ~/Library/Caches/Docker Desktop/ ~/Library/Logs/Docker Desktop/ ~/Library/Preferences/com.docker.docker.plist ~/Library/Containers/com.docker.docker/ ~/Library/Saved Application State/com.electron.docker-frontend.savedState ~/.docker/

luck

DuMaM commented 4 months ago

@luisgagocasas you probably removed daemon.json with bad records like mine when you dropped .docker

jbelke commented 4 months ago

Issue resolved when reverting back to v4.32 from release.

revett commented 4 months ago

It happened to me that I updated docker and when I booted up I got the same message.

I solved it by completely eliminating docker, here are the steps I followed to solve the problem.

Click Go > Go to Folder and navigate to the following folders. ~/Library/Application Support/Docker Desktop/ ~/Library/Caches/Docker Desktop/ ~/Library/Logs/Docker Desktop/ ~/Library/Preferences/com.docker.docker.plist ~/Library/Containers/com.docker.docker/ ~/Library/Saved Application State/com.electron.docker-frontend.savedState ~/.docker/

luck

This worked for me, my steps:

umair-me commented 4 months ago

Will uninstalling docker desktop also remove containers and volumes?

rennsport commented 3 months ago

Will uninstalling docker desktop also remove containers and volumes?

@umair-me, yes this is a destructive solution. Deleting ~/Library/Containers/com.docker.docker/ as suggested in https://github.com/docker/for-mac/issues/7340#issuecomment-2195741371 will remove the VM that Docker uses to run on macOS which does contain all your containers and images. I'm unsure about volumes, but I typically mount local files on my Mac from outside of that VM which this solution shouldn't touch; e.g. I mount ~/Desktop/test/ to a container's ~/test directory. The test directory on my Mac's desktop wouldn't be touched by following @luisgagocasas' comment.

ivancortesromero commented 3 months ago

It happened to me when upgrading to 4.33. In addition, Docker froze after I clicked to get diagnostics.

I closed Docker Desktop and started it again and all looks working perfectly without doing anything additional.

NarekPVP commented 3 months ago

Just remove .docker

Inside of Finder just click to Go -> Go to folder... -> Paste ~/.docker/ and remove it.

DynamicApproach commented 3 months ago

Experienced a similar issue on client 27.1.1 with Public Beta since updating the other day and trying to open Docker Desktop v4.33.0

Tried removing all suggested files and had perms issues. Only thing that solved it for me was:

  1. booting to recovery mode
  2. removing the containers folder,
  3. rebooting immediately after removing that, and opening Docker
  4. When Docker opened, it opened to the end of the installer.

rm -rf Library/Containers/com.docker.docker

This of course removed all my containers but allowed me to open Docker without crashing.

Example of info

docker info
Client:
Version:    27.1.1
Context:    desktop-linux
Debug Mode: false
Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.1-desktop.1
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.1-desktop.1
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.34
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.14
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.25
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.3.0
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.11.0
    Path:     /Users/DynamicApproach/.docker/cli-plugins/docker-scout

Server:
ERROR: request returned Internal Server Error for API route and version http://%2FUsers%2FDynamicApproach%2F.docker%2Frun%2Fdocker.sock/v1.46/info, check if the server supports the requested API version
errors pretty printing info

May not be directly relevant though

bhekster-relyance commented 3 months ago

For what it's worth— I tried every suggestion mentioned here and then some. The one that did the trick for me was

rm -rf ~/Library/Containers/com.docker.docker/

YMMV

LjessonS commented 2 months ago

Just remove .docker

Inside of Finder just click to Go -> Go to folder... -> Paste ~/.docker/ and remove it.

Great! Docker works again on my mac!

katayama8000 commented 2 months ago

It happened to me that I updated docker and when I booted up I got the same message.

I solved it by completely eliminating docker, here are the steps I followed to solve the problem.

Click Go > Go to Folder and navigate to the following folders. ~/Library/Application Support/Docker Desktop/ ~/Library/Caches/Docker Desktop/ ~/Library/Logs/Docker Desktop/ ~/Library/Preferences/com.docker.docker.plist ~/Library/Containers/com.docker.docker/ ~/Library/Saved Application State/com.electron.docker-frontend.savedState ~/.docker/

luck

It works for me. Thanks!!!

rangerisrael commented 2 months ago

Ok I found the issue, adding "insecure-registries" : [ "****", "****" ] to daemon.json makes it unable to start

thanks i fixed by removing this "insecure-registries"