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

Serving Docker API: Shared Listener Closed

Open nothing2obvi opened this issue 2 years ago • 11 comments

Description

Docker Desktop for Mac 4.28.0 quits and gives error: "serving docker api: shared listener closed."

Reproduce

  1. Run Docker
  2. After a few hours, get error and it quits

Expected behavior

Docker does not quit and give error

docker version

Client:
 Cloud integration: v1.0.35+desktop.11
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:26 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.28.0 (139021)
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:22 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    25.0.3
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
	Version:  v0.12.1-desktop.4
	Path:     /Users/username/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
	Version:  v2.24.6-desktop.1
	Path:     /Users/username/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
	Version:  0.0.24
	Path:     /Users/username/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
	Version:  v0.1.0
	Path:     /Users/username/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
	Version:  v0.2.22
	Path:     /Users/username/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
	Version:  v1.0.4
	Path:     /Users/username/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
	Version:  v1.0.1
	Path:     /Users/username/.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/username/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
	Version:  v1.5.0
	Path:     /Users/username/.docker/cli-plugins/docker-scout
WARNING: Plugin "/Users/username/.docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /Users/username/.docker/cli-plugins/docker-scan: no such file or directory

Server:
 Containers: 21
  Running: 21
  Paused: 0
  Stopped: 0
 Images: 33
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.16-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 8
 Total Memory: 5.79GiB
 Name: docker-desktop
 ID: d6b53848-2a39-488a-9974-a7b8f38d492a
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

Diagnostics ID

32CE3ED3-27F3-4B22-B2F0-A2F758C9C846/20240321180345

Additional Info

No response

nothing2obvi avatar Mar 21 '24 18:03 nothing2obvi

I have tried completely uninstalling (and deleting residual files) according to the documentation, restarting, reinstalling Docker Desktop for Mac 4.28.0, and rebuilding my containers. After a few hours, Docker Desktop quits and I get the same error as in my original post.

I have also tried the same thing with 4.27.2 and 4.27.0 with no luck.

I was running 4.28.0 just fine for a few weeks and then this started happening.

nothing2obvi avatar Mar 22 '24 21:03 nothing2obvi

I downgraded to 4.26.1 and the problem seems to have disappeared. Will provide updates.

nothing2obvi avatar Mar 23 '24 19:03 nothing2obvi

Although 4.26.1 doesn't quit on me, it does freeze up every 6-8 hours and I have to force quit Docker and open it again.

nothing2obvi avatar Mar 25 '24 23:03 nothing2obvi

Same issue with locking up every 6-8 hours on 4.26.0.

I'm not sure why this is happening. I didn't have this problem on any of those versions before I upgraded to 4.28.0.

When I run the self-diagnose command on versions 4.26.0 through 4.28.0 it says the binaries aren't symlinked in /usr/local/bin which doesn't make sense because I can clearly see them within that directory.

nothing2obvi avatar Mar 27 '24 17:03 nothing2obvi

I tried uninstalling everything and deleting all residual files, as seen below, and reinstalling 4.28.0. The same issue occurs, or Docker Desktop will say "Docker Engine stopped" after 6-8 hours.

sudo rm -rf ~/Library/Group\ Containers/group.com.docker
sudo rm -rf ~/Library/Containers/com.docker.docker
sudo rm -rf ~/.docker
sudo rm -rf ~/Library/Application Scripts/com.docker.helper
sudo rm -rf ~/Library/Caches/com.docker.docker
sudo rm -rf ~/Library/Containers/com.docker.docker
sudo rm -rf ~/Library/Containers/com.docker.helper
sudo rm -rf /Library/PrivilegedHelperTools/com.docker.vmnetd
sudo rm -rf /Library/LaunchDaemons/com.docker.vmnetd.plist
sudo rm -rf /usr/local/lib/docker
sudo rm -rf ~/.docker
sudo rm -rf ~/Library/Application Support/Docker Desktop
sudo rm -rf ~/Library/Preferences/com.docker.docker.plist
sudo rm -rf ~/Library/Preferences/com.electron.docker-frontend.plist
sudo rm -rf ~/Library/Saved Application State/com.electron.docker-frontend.savedState
sudo rm -rf ~/Library/Group Containers/group.com.docker
sudo rm -rf ~/Library/Logs/Docker Desktop
sudo rm -rf ~/Library/Preferences/com.electron.docker-frontend.plist
sudo rm -rf ~/Library/Cookies/com.docker.docker.binarycookies

I tried repeating the process but this time installing Docker CLI tools in $HOME/.docker/bin and following the instructions on setting PATH but I still get the following errors (below) regarding symlinks, which I also got when I had previously installed the tools in /usr/local/bin.

EDIT: Even on this setup, with the tools in $HOME/.docker/bin, I get the error "serving docker api: shared listener closed."

On either type of setup, I've been getting the following errors upon diagnose check:

Please note the following 3 warnings:

1 : The check: are the binary symlinks installed?
    Produced the following warning: checking binaries in /usr/local/bin: looking for /usr/local/bin/docker: lstat /usr/local/bin/docker: no such file or directory
checking binaries in $HOME/.docker/bin: looking for /Users/username/.docker/bin/docker-credential-ecr-login: lstat /Users/username/.docker/bin/docker-credential-ecr-login: no such file or directory

The symlinks to the docker CLI etc are needed for docker commands to work.

2 : The check: does the Docker API work?
    Produced the following warning: prereq failed: are the binary symlinks installed?

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

3 : 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: are the binary symlinks installed?
    Failed with: checking binaries in /usr/local/bin: looking for /usr/local/bin/docker: lstat /usr/local/bin/docker: no such file or directory
checking binaries in $HOME/.docker/bin: looking for /Users/username/.docker/bin/docker-credential-ecr-login: lstat /Users/username/.docker/bin/docker-credential-ecr-login: no such file or directory

The symlinks to the docker CLI etc are needed for docker commands to work.

By the way, this is all occurring on a Mac Mini with M1 Chip, Sonoma 14.4.1. On my Intel Mac Mini, Monterey, 12.7.4, I get no errors upon diagnose check.

nothing2obvi avatar Mar 28 '24 18:03 nothing2obvi

I am experiencing the same issue and error as described above. This has been ongoing for a couple of months. I am running on a MacBook Pro, Sonoma 14.1, with M2 chip. Currently running Docker 24.0.6.

Docker Version

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:28:49 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.25.2 (129061)
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:31:36 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Docker Info

Client:
 Version:    24.0.6
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.5
    Path:     /Users/username/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.0-desktop.1
    Path:     /Users/username/.docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/username/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     /Users/username/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.9
    Path:     /Users/username/.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/username/.docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /Users/username/.docker/cli-plugins/docker-scan
  scout: Docker Scout (Docker Inc.)
    Version:  v1.0.9
    Path:     /Users/username/.docker/cli-plugins/docker-scout

Server:
 Containers: 53
  Running: 4
  Paused: 0
  Stopped: 49
 Images: 26
 Server Version: 24.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.4.16-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 8
 Total Memory: 11.68GiB
 Name: linuxkit-62546df94e9d
 ID: be8b190a-e3f3-475a-a164-2a31fde60a9c
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

redirwin avatar Mar 28 '24 23:03 redirwin

Did a full uninstall of 4.28.0 and downgraded to 4.25.0. Upon self-diagnosis, I receive the message: No fatal errors detected. I will report back about whether it stalls and says Docker engine stopped or quits.

nothing2obvi avatar Mar 28 '24 23:03 nothing2obvi

4.25.0 stalls upon relatively heavy use, but does not say Docker engine stopped or quits. In terms of how long it runs before it stalls, it seems to last longer than 4.28.0.

nothing2obvi avatar Mar 30 '24 21:03 nothing2obvi

I've been getting the same issue as well, as my Mac Mini M2 is now my main server and everything runs on it.

I'm on Docker Desktop 4.28.0, Docker Engine 25.0.3. Would like to see a solution to fixing the issue.

ghost avatar Apr 08 '24 00:04 ghost

Upgraded to Docker Desktop 4.29.0 and the problem persists. The new error is:

"running services: running services: running Docker API Proxy: shared listener closed"

Screen Shot 2024-04-08 at 2 16 05 PM

nothing2obvi avatar Apr 08 '24 23:04 nothing2obvi

closing as a duplicate of https://github.com/docker/for-mac/issues/7242

dgageot avatar Apr 10 '24 12:04 dgageot