docker / for-mac

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

Docker engine hangs if left running overnight #7069

Open Joymaker opened 11 months ago

Joymaker commented 11 months ago

Description

I am running Docker under Mac OS 11.6 "Big Sur". My first installation got completely corrupted, so I went through a thorough process to uninstall it and then reinstalled using the recommended brew install --cask docker

After that, and after running the Docker desktop application, things worked, and I could use commands like docker build . For the most part I'm using it under AWS SAM CLI. But the sickness comes creeping back...

Here's what I'm finding: I start Docker desktop, things work. I walk away overnight or for a few hours, I come back, and nothing works anymore. A docker build just hangs for hours. Should have taken less than five minutes. The attempt to quit or to factory reset Docker Desktop hangs. I finally used command-option-escape to kill it, and tried restarting it. It just has this message across a big blank window that says "Docker Engine stopped". (Well, then, give me a button to restart it!) But no, no further progress can be made. Except to reboot. That works.

After reboot, docker desktop says "failed to load extensions." I wasn't aware that I had installed any extensions. Hmm... I dare not accept its invitation to update itself, on my previous installation that just made matters worse. The Mac says, during rebooting, "You restarted because of a problem." Wow, this would suggest that, even though I was able to give the restart command normally from the menu, something was corrupted in the kernel and it knew it! And now it works... for how long??

Is there a good way to manually restart the docker daemon?

Reproduce

  1. Start Docker desktop
  2. Use it normally from the command line
  3. Leave it running overnight. (I find that, if I quit docker desktop within two hours of having last used it, everything is all right.)

Expected behavior

The Docker daemon does not quit or deadlock.

docker version

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
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/amd64
 Context:           default

docker info

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

84BAFB65-6A83-4C56-B1BE-67867AB11A4D/20231109134528

Additional Info

System Software Overview:

System Version: macOS 11.6 (20G165) Kernel Version: Darwin 20.6.0 Boot Volume: MainMac Boot Mode: Normal Computer Name: Ken’s MacBook Pro User Name: Ken (ken) Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 1 day 13:02

Hardware Overview:

Model Name: MacBook Pro Model Identifier: MacBookPro11,5 Processor Name: Quad-Core Intel Core i7 Processor Speed: 2.8 GHz Number of Processors: 1 Total Number of Cores: 4 L2 Cache (per Core): 256 KB L3 Cache: 6 MB Hyper-Threading Technology: Enabled Memory: 16 GB System Firmware Version: 427.140.8.0.0 SMC Version (system): 2.30f2 Serial Number (system): C02RW3AXG8WM Hardware UUID: 76160CD8-B584-586E-874D-DABC307BB9A1 Provisioning UDID: 76160CD8-B584-586E-874D-DABC307BB9A1

rmeske commented 11 months ago

I encountered this when the engine goes into Resource Saver mode. While in this mode, the Desktop page keeps reloading. I have tried the "play" button next to the engine status at the bottom of the window, but it does not seem to do anything. I have also tried the Restart in the Docker Desktop menu item and Troubleshoot modes. The only solution I have found that works is to quit Docker Desktop and the launch again.

I am running MacOS Ventura and the latest version of Docker Desktop.

delboy1978uk commented 11 months ago

Resource Saver mode does indeed seem screwed up, I can't get out of resource saver mode once Docker enters it, and I need to close it completely down and reopen it. I'm pretty sure I disabled that feature too a few weeks back, maybe an update re-enabled it, I'm not sure, but I just had this same problem again just there.