Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Docker daemon on MacOS intel #7553

Open
nbdavies opened this issue Jan 17, 2025 · 3 comments
Open

No Docker daemon on MacOS intel #7553

nbdavies opened this issue Jan 17, 2025 · 3 comments

Comments

@nbdavies
Copy link

Description

Docker commands persistently fail with a message ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
This is occurring after going through all remediation steps in #7527 (including restarting Docker Desktop, restarting the machine, uninstalling/reinstalling version 4.37.2

Troubleshoot > Get Support output

Diagnose Failed
$ /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Starting diagnostics

[2025-01-17T17:41:33.217115000Z][com.docker.diagnose.ipc] fc1846ec-diagnose -> <HOME>/Library/Containers/com.docker.docker/Data/backend.sock BackendAPI
[2025-01-17T17:41:33.220193000Z][com.docker.diagnose.ipc] (5885d36f-0) fc1846ec-diagnose C->S BackendAPI POST /idle/make-busy
[2025-01-17T17:41:33.228876000Z][com.docker.diagnose.ipc][W] (5885d36f-0) fc1846ec-diagnose C<-S ConnectionClosed POST /idle/make-busy (8.695343ms): Post "http://ipc/idle/make-busy": dial unix <HOME>/Library/Containers/com.docker.docker/Data/backend.sock: connect: connection refused
[2025-01-17T17:41:34.218925000Z][com.docker.diagnose.ipc] (5885d36f-2) fc1846ec-diagnose C->S BackendAPI GET /idle
[2025-01-17T17:41:34.221340000Z][com.docker.diagnose.ipc][W] (5885d36f-2) fc1846ec-diagnose C<-S ConnectionClosed GET /idle (2.46109ms): Get "http://ipc/idle": dial unix <HOME>/Library/Containers/com.docker.docker/Data/backend.sock: connect: connection refused
[PASS] DD0027: is there available disk space on the host?
[SKIP] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[FAIL] DD0001: is the application running? Docker is not running
[PASS] DD0017: can a VM be started?
[FAIL] DD0016: is the LinuxKit VM running? prereq failed: is the application running?
[FAIL] DD0004: is the Docker engine running? prereq failed: is the LinuxKit VM running?
[PASS] DD0015: are the binary symlinks installed?
[FAIL] DD0031: does the Docker API work? prereq failed: is the Docker engine running?
[PASS] DD0013: is the $PATH ok?
[FAIL] DD0003: is the Docker CLI working? prereq failed: is the Docker engine running?
[FAIL] DD0037: is the connection to Docker working? prereq failed: is the Docker engine running?
[FAIL] DD0014: are the backend processes running? prereq failed: is the LinuxKit VM running?
[FAIL] DD0007: is the backend responding? prereq failed: are the backend processes running?
[FAIL] DD0010: is the Docker API proxy responding? prereq failed: are the backend processes running?
[FAIL] DD0030: is the image access management authorized? prereq failed: is the Docker engine running?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[WARN] DD0001: is the application running? Docker is not running
[PASS] DD0017: can a VM be started?
[WARN] DD0016: is the LinuxKit VM running? prereq failed: is the application running?
[WARN] DD0004: is the Docker engine running? prereq failed: is the LinuxKit VM running?
[PASS] DD0015: are the binary symlinks installed?
[WARN] DD0031: does the Docker API work? prereq failed: is the Docker engine running?
[WARN] DD0032: do Docker networks overlap with host IPs? prereq failed: does the Docker API work?

Please note the following 5 warnings:

1 : The check: is the application running?
    Produced the following warning: Docker is not running

Is the Docker Desktop application running?

2 : The check: is the LinuxKit VM running?
    Produced the following warning: prereq failed: is the application running?

The Docker engine runs inside a Linux VM. Therefore the VM must be running.

3 : The check: is the Docker engine running?
    Produced the following warning: prereq failed: is the LinuxKit VM running?

The Docker engine manages all containers and images on the host. Check the dockerd.log to see why it failed to start.

4 : The check: does the Docker API work?
    Produced the following warning: prereq failed: is the Docker engine running?

If the Docker API is not available from the host then Docker Desktop will not work correctly.

5 : The check: do Docker networks overlap with host IPs?
    Produced the following warning: prereq failed: does the Docker API work?

If the subnet used by a Docker network overlaps with an IP used by the host, then containers
won't be able to contact the overlapping IP addresses.

Try configuring the IP address range used by networks: in your docker-compose.yml.
See https://docs.docker.com/compose/compose-file/compose-file-v2/#ipv4_address-ipv6_address


Please investigate the following 1 issue:

1 : The test: is the application running?
    Failed with: Docker is not running

Is the Docker Desktop application running?

(Docker Desktop is in fact running.)

Upon starting Docker Desktop, there's this error notification:
Image

Attempting to update settings in Docker Desktop flashes this error message:
Image
(That includes making any changes to Settings > Extensions to resolve the previous error.)

Docker Desktop does not quit when this option is selected (it requires Force Quit instead):
Image

This collection of symptoms leads me to suspect that a rushed patch for the "malware" bug may have created other bugs, particularly for MacOS intel users. (Teammates with MacOS Apple Silicon (M1, M2...) are not seeing this issue.)

Reproduce

  1. Install Docker Desktop 4.37.2 on MacOS with an Intel processor.
  2. Run through the remediation steps from Malware detection prevents Docker Desktop to start #7527 as much as you please.
  3. Attempt docker commands like docker info
  4. See error messages including Cannot connect to the Docker daemon at (path). Is the docker daemon running?

Expected behavior

Docker daemon should be running

docker version

$ docker version
Client:
 Version:           27.4.0
 API version:       1.47
 Go version:        go1.22.10
 Git commit:        bde2b89
 Built:             Sat Dec  7 10:35:43 2024
 OS/Arch:           darwin/amd64
 Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

docker info

$ docker info
Client:
 Version:    27.4.0
 Context:    default
 Debug Mode: false
 Plugins:
  ai: Ask Gordon - Docker Agent (Docker Inc.)
    Version:  v0.5.1
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-ai
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.2-desktop.1
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.31.0-desktop.2
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.37
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Beta) (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.27
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     /Users/nick.davies/.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/nick.davies/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.15.1
    Path:     /Users/nick.davies/.docker/cli-plugins/docker-scout

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

Diagnostics ID

Diagnose Failed

Additional Info

Daemon logs from ~/Library/Containers/com.docker.docker/Data/log/vm/containerd.log:

-------------------------------------------------------------------------------->8
time="2025-01-17T17:50:08.156194019Z" level=info msg="starting containerd" revision=472731909fa34bd7bc9c087e4c27943f9835f111 version=1.7.21
time="2025-01-17T17:50:08.192537665Z" level=info msg="loading plugin \"io.containerd.event.v1.exchange\"..." type=io.containerd.event.v1
time="2025-01-17T17:50:08.192607306Z" level=info msg="loading plugin \"io.containerd.internal.v1.opt\"..." type=io.containerd.internal.v1
time="2025-01-17T17:50:08.192835228Z" level=info msg="loading plugin \"io.containerd.warning.v1.deprecations\"..." type=io.containerd.warning.v1
time="2025-01-17T17:50:08.192873636Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." type=io.containerd.snapshotter.v1
time="2025-01-17T17:50:08.193663846Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." error="no scratch file generator: skip plugin" type=io.containerd.snapshotter.v1
time="2025-01-17T17:50:08.193767258Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1
time="2025-01-17T17:50:08.194855650Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1
time="2025-01-17T17:50:08.196167897Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1
time="2025-01-17T17:50:08.198198587Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.stargz\"..." type=io.containerd.snapshotter.v1
time="2025-01-17T17:50:08.202577811Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1
time="2025-01-17T17:50:08.202756300Z" level=info msg="metadata content store policy set" policy=shared
time="2025-01-17T17:50:08.205248626Z" level=info msg="loading plugin \"io.containerd.gc.v1.scheduler\"..." type=io.containerd.gc.v1
time="2025-01-17T17:50:08.205419548Z" level=info msg="loading plugin \"io.containerd.differ.v1.walking\"..." type=io.containerd.differ.v1
time="2025-01-17T17:50:08.205443822Z" level=info msg="loading plugin \"io.containerd.lease.v1.manager\"..." type=io.containerd.lease.v1
time="2025-01-17T17:50:08.205460336Z" level=info msg="loading plugin \"io.containerd.streaming.v1.manager\"..." type=io.containerd.streaming.v1
time="2025-01-17T17:50:08.205475503Z" level=info msg="loading plugin \"io.containerd.runtime.v1.linux\"..." type=io.containerd.runtime.v1
time="2025-01-17T17:50:08.205706678Z" level=info msg="loading plugin \"io.containerd.monitor.v1.cgroups\"..." type=io.containerd.monitor.v1
time="2025-01-17T17:50:08.207050816Z" level=info msg="loading plugin \"io.containerd.runtime.v2.task\"..." type=io.containerd.runtime.v2
time="2025-01-17T17:50:08.207417832Z" level=info msg="loading plugin \"io.containerd.runtime.v2.shim\"..." type=io.containerd.runtime.v2
time="2025-01-17T17:50:08.207557015Z" level=info msg="loading plugin \"io.containerd.sandbox.store.v1.local\"..." type=io.containerd.sandbox.store.v1
time="2025-01-17T17:50:08.207585222Z" level=info msg="loading plugin \"io.containerd.sandbox.controller.v1.local\"..." type=io.containerd.sandbox.controller.v1
time="2025-01-17T17:50:08.207602676Z" level=info msg="loading plugin \"io.containerd.service.v1.containers-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207675107Z" level=info msg="loading plugin \"io.containerd.service.v1.content-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207694129Z" level=info msg="loading plugin \"io.containerd.service.v1.diff-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207787389Z" level=info msg="loading plugin \"io.containerd.service.v1.images-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207813037Z" level=info msg="loading plugin \"io.containerd.service.v1.introspection-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207846045Z" level=info msg="loading plugin \"io.containerd.service.v1.namespaces-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207898362Z" level=info msg="loading plugin \"io.containerd.service.v1.snapshots-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207914754Z" level=info msg="loading plugin \"io.containerd.service.v1.tasks-service\"..." type=io.containerd.service.v1
time="2025-01-17T17:50:08.207985437Z" level=info msg="loading plugin \"io.containerd.grpc.v1.containers\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208008113Z" level=info msg="loading plugin \"io.containerd.grpc.v1.content\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208025419Z" level=info msg="loading plugin \"io.containerd.grpc.v1.diff\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208039165Z" level=info msg="loading plugin \"io.containerd.grpc.v1.events\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208052834Z" level=info msg="loading plugin \"io.containerd.grpc.v1.images\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208069343Z" level=info msg="loading plugin \"io.containerd.grpc.v1.introspection\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208086605Z" level=info msg="loading plugin \"io.containerd.grpc.v1.leases\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208118792Z" level=info msg="loading plugin \"io.containerd.grpc.v1.namespaces\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208137173Z" level=info msg="loading plugin \"io.containerd.grpc.v1.sandbox-controllers\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208155545Z" level=info msg="loading plugin \"io.containerd.grpc.v1.sandboxes\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208168907Z" level=info msg="loading plugin \"io.containerd.grpc.v1.snapshots\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208182973Z" level=info msg="loading plugin \"io.containerd.grpc.v1.streaming\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208268658Z" level=info msg="loading plugin \"io.containerd.grpc.v1.tasks\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208417354Z" level=info msg="loading plugin \"io.containerd.transfer.v1.local\"..." type=io.containerd.transfer.v1
time="2025-01-17T17:50:08.208504676Z" level=info msg="loading plugin \"io.containerd.grpc.v1.transfer\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208533288Z" level=info msg="loading plugin \"io.containerd.grpc.v1.version\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208553179Z" level=info msg="loading plugin \"io.containerd.internal.v1.tracing\"..." type=io.containerd.internal.v1
time="2025-01-17T17:50:08.208584894Z" level=info msg="skip loading plugin \"io.containerd.internal.v1.tracing\"..." error="skip plugin: tracing endpoint not configured" type=io.containerd.internal.v1
time="2025-01-17T17:50:08.208637995Z" level=info msg="loading plugin \"io.containerd.grpc.v1.healthcheck\"..." type=io.containerd.grpc.v1
time="2025-01-17T17:50:08.208661980Z" level=info msg="loading plugin \"io.containerd.nri.v1.nri\"..." type=io.containerd.nri.v1
time="2025-01-17T17:50:08.208760344Z" level=info msg="NRI interface is disabled by configuration."
time="2025-01-17T17:50:08.209651581Z" level=info msg=serving... address=/run/containerd/containerd.sock.ttrpc
time="2025-01-17T17:50:08.210065479Z" level=info msg=serving... address=/run/containerd/containerd.sock
time="2025-01-17T17:50:08.210320839Z" level=info msg="containerd successfully booted in 0.056159s"
@michaelcosley
Copy link

michaelcosley commented Jan 21, 2025

@nbdavies I was having the exact same issue as you but I just managed to fix it.

Here are the exact steps, as best as I am able to remember them.

Before solution: I had attempted multiple uninstalls/reinstalls, and including attempting to uninstall things manually, and eventually completing a fresh install via brew.

Steps in my solution:
1. Install a fresh Docker install via brew update && brew install docker --cask
2. Follow the steps here exactly, but run each command line by line. (Search for the 'Tip' codeblock immediately following 'Privileged users' on the page).
a. Ensure Docker Desktop is not running (it wasn't for me, and probably isn't for you, so you can probably skip this).
b. Enter the following commands into a terminal, line by line, one at a time (ignore comments).

# Run these commands in terminal, one line at a time.
- `sudo pkill '[dD]ocker'`
- `sudo launchctl bootout system /Library/LaunchDaemons/com.docker.vmnetd.plist`
- `sudo launchctl bootout system /Library/LaunchDaemons/com.docker.socket.plist`
- `sudo rm -f /Library/PrivilegedHelperTools/com.docker.vmnetd`
- `sudo rm -f /Library/PrivilegedHelperTools/com.docker.socket`
- `sudo cp /Applications/Docker.app/Contents/Library/LaunchServices/com.docker.vmnetd /Library/PrivilegedHelperTools/`
- `sudo cp /Applications/Docker.app/Contents/MacOS/com.docker.socket /Library/PrivilegedHelperTools/`
**c.** attempt to open Docker.

After entering these commands a single line at a time, I was able to resolve my issue with docker. My previous version of docker had been installed ~October 12, 2024, and I just saw the Mac malware notice pop up yesterday (January 20, 2025). That's when this issue began, and I attempted to do a clean install of docker and ran into this error. Initially, I had try copy/pasting all the commands into a terminal window at once, and I got an error or something (don't recall exact thing).

Here is the error I got when I tried pasting the whole script into my Mac terminal:

Last login: Tue Jan 21 11:47:50 on ttys001
#!/bin/bash

# Stop the docker services
echo "Stopping Docker..."
sudo pkill '[dD]ocker'

# Stop the vmnetd service
echo "Stopping com.docker.vmnetd service..."
sudo launchctl bootout system /Library/LaunchDaemons/com.docker.vmnetd.plist

# Stop the socket service
echo "Stopping com.docker.socket service..."
sudo launchctl bootout system /Library/LaunchDaemons/com.docker.socket.plist

# Remove vmnetd binary
echo "Removing com.docker.vmnetd binary..."
sudo rm -f /Library/PrivilegedHelperTools/com.docker.vmnetd

# Remove socket binary
echo "Removing com.docker.socket binary..."
sudo rm -f /Library/PrivilegedHelperTools/com.docker.socket

# Install new binaries
echo "Install new binaries..."
sudo cp /Applications/Docker.app/Contents/Library/LaunchServices/com.docker.vmnetd /Library/PrivilegedHelperTools/
sudo cp /Applications/Docker.app/Contents/MacOS/com.docker.socket /Library/PrivilegedHelperTools/%                                                              (base) *******@******* ~ % #!/bin/bash
zsh: event not found: /bin/bash

I think I also tried putting it into shell file (.sh), ensuring it was executable with chmod, and then running it, but I don't remember what happened.


Just to be clear, this is basically exactly the situation I found myself in:

**Reproduce**
- Install Docker Desktop 4.37.2 on MacOS with an Intel processor.
- Run through the remediation steps from https://github.com/docker/for-mac/issues/7527 as much as you please.
- Attempt docker commands like docker info
- See error messages including Cannot connect to the Docker daemon at (path). Is the docker daemon running?

Hope this helps!

@nbdavies
Copy link
Author

@michaelcosley I appreciate the spirit in which the suggestion was given. Sounds like you were running into #7527, and the remediation steps from #7527 worked for you. That's great. Sounds like you are not one of the users affected by this issue.

To be able to say I did, I ran through those steps for the nth time too ✔ , and I'm still experiencing the issue described above.

$ docker-compose up
unable to get image 'zookeeper': Cannot connect to the Docker daemon at unix:///Users/nick.davies/.docker/run/docker.sock. Is the docker daemon running?

@zachary-foreflight
Copy link

I'm not sure if my issue is the same as yours, but my Docker Desktop app was also not initializing the daemon, and the application window was never being initialized either.

I was using the same version as you (4.37.2), on the most recent version of MacOS (15.2), but running on an M1 Max chip.

My issue was resolved by uninstalling Docker Desktop through AppCleaner, restarting my computer, then reinstalling. Maybe that helps. I noticed that many symbolic links were not being deleted when I just deleted the ".app" file from the Applications/ directory, and AppCleaner found many more related files which remained on my system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants