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

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

Open snowdream opened this issue 1 year ago • 20 comments

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

snowdream avatar Jun 25 '24 23:06 snowdream

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 avatar Jun 27 '24 07:06 DuMaM

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

DuMaM avatar Jun 27 '24 07:06 DuMaM

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

luisgagocasas avatar Jun 27 '24 22:06 luisgagocasas

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

DuMaM avatar Jul 01 '24 08:07 DuMaM

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

jbelke avatar Jul 10 '24 14:07 jbelke

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:

  • Uninstall Homebrew cask
  • Delete all directories mentioned in @luisgagocasas' comment
  • Install Homebrew cask
  • Start Docker Desktop
  • App will notify you to "Reapply configuration"
  • Restart engine

revett avatar Jul 19 '24 12:07 revett

Will uninstalling docker desktop also remove containers and volumes?

umair-me avatar Jul 20 '24 23:07 umair-me

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.

rennsport avatar Aug 06 '24 03:08 rennsport

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.

ivancortesromero avatar Aug 09 '24 00:08 ivancortesromero

Just remove .docker

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

NarekPVP avatar Aug 10 '24 17:08 NarekPVP

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

DynamicApproach avatar Aug 18 '24 04:08 DynamicApproach

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

bhekster-relyance avatar Aug 23 '24 22:08 bhekster-relyance

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!

LjessonS avatar Sep 03 '24 01:09 LjessonS

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!!!

katayama8000 avatar Sep 14 '24 03:09 katayama8000

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

thanks i fixed by removing this "insecure-registries"

rangerisrael avatar Sep 21 '24 14:09 rangerisrael

This worked for me:

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

No need for restart nor starting in recovery mode though it deleted all my containers.

tomasg88 avatar Nov 26 '24 20:11 tomasg88

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

Although I don't know what caused it, I solved it by following the steps you mentioned. Hopefully, official developers will notice this as well, and it will really bother people who upgrade versions

zhanbei1 avatar Nov 27 '24 01:11 zhanbei1

~/.docker/

thanks,i resolved by your func,

strivezheng avatar Jan 24 '25 02:01 strivezheng

After upgrading from 4.20 to 4.38 with Windows 11 over WSL, same message:

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

After restarting the computer, it offers to recover WSL when starting Docker Desktop.

I accepted and all seems to work fine (no information lost)

framontb avatar Feb 20 '25 17:02 framontb

You can try a lower version

happyboy8786 avatar Feb 22 '25 13:02 happyboy8786

"Reset to factory defaults" worked for me actually.

SergeyZharikhin avatar Mar 28 '25 15:03 SergeyZharikhin

I got the same message after updating Docker, but simply turning Docker Desktop off and back on solved it for me.

macOS Sequoia (15.3.2)
Docker Desktop Version 4.39.0 (184744)
Engine: 28.0.1
Compose: v2.33.1-desktop.1
Credential Helper: v0.8.2
Kubernetes: v1.32.2

bpcdpc avatar Apr 07 '25 01:04 bpcdpc

I renamed the ~/.docker/ folder to ~/.docker.old/ and Docker started immediately without a problem. All of my containers were still there and running.

Thanks to @DuMaM and @NarekPVP for the succinct solution.

mvonballmo avatar May 24 '25 11:05 mvonballmo

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.

Quiting Docker Desktop, running rm -rf ~/.docker and opening Docker Desktop again did the trick. Thanks all!

folushooladipo avatar Jun 22 '25 22:06 folushooladipo

Isso funcionou para mim:

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

Não há necessidade de reiniciar nem iniciar no modo de recuperação, embora tenha excluído todos os meus contêineres.

It Solved

pabloteodoro avatar Jun 30 '25 23:06 pabloteodoro