docker / for-mac

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

Computer storage filling up with System Data from thousands of "electrons" in Host directory #7428

Closed mx-ruthie closed 3 weeks ago

mx-ruthie commented 1 month ago

Description

Got notification that the system data on my computer was full: storage on new computer nearly full Tracked it down using DaisyDisk: DaisyDisk scan

The Host folder was hoarding 15,000+ "electrons" that I had to manually delete after all pruning activities failed. host file full of thousands of electrons

Several other people at my company are also experiencing this one after the other and we're circulating the fix we tracked down to dump all the files out of the Host directory manually.

Reproduce

Not sure how to reproduce but hopefully the screenshots of the issue will help.

Expected behavior

I would expect Docker not to maybe infinitely look the same error?

docker version

Server: Docker Desktop 4.34.2 (167172)
 Engine:
  Version:          27.2.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.21.13
  Git commit:       3ab5c7d
  Built:            Tue Aug 27 14:15:41 2024
  OS/Arch:          linux/arm64
  Experimental:     false

docker info

Client:
 Version:    27.2.0
 Context:    desktop-linux
 Debug Mode: false
Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.2-desktop.1
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.2-desktop.2
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.34
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.15
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.25
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.3.0
    Path:     /Users/ruthieirvin/.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/ruthieirvin/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.13.0
    Path:     /Users/ruthieirvin/.docker/cli-plugins/docker-scout

Server:
 Containers: 6
  Running: 6

Diagnostics ID

A48EDB00-A3D9-439D-A98A-A3AE25495F9C/20240923184758

Additional Info

Happy to cooperate however.

mark-dr commented 1 month ago

Thanks for raising this, and sorry for the pain it's causing. We've identified the likely cause and we've got a patch into 4.35 (released this week). We think that'll fix it, but we're also tightening up our logging code as extra protection against this sort of over-logging, and hopefully we'll get that into this week's release as well. Please let us know if this persists in 4.35 and I'll make it my top priority to fix it.

nivhanin commented 1 month ago

same issue persist on my M1 Pro: 4.34.2 (167172) My Mac filled with 685 Gigs of logs. Screenshot 2024-09-26 at 15 04 21 at least 3 files (size: 21MB) of electron.log every minute

image

mark-dr commented 1 month ago

Quick update: We've hit some delays on releasing 4.35, so we're planning to release a 4.34.3 version (likely this week) that addresses this issue.

adambirds commented 1 month ago

Has this been released yet?

mark-dr commented 1 month ago

@mx-ruthie, @nivhanin, @adambirds: Sorry for the delay, but I'm happy to let you know that 4.34.3 released today! It'll be offered to you in the app as it's rolled out to users, or you can jump the queue and grab an installer - see release notes and download links here.

The new version should immediately clear up your log files when you run it and then keep them at a reasonable level. Please reach out here if you see any issues and I'll jump straight on it.

adambirds commented 1 month ago

@mx-ruthie, @nivhanin, @adambirds: Sorry for the delay, but I'm happy to let you know that 4.34.3 released today! It'll be offered to you in the app as it's rolled out to users, or you can jump the queue and grab an installer - see release notes and download links here.

The new version should immediately clear up your log files when you run it and then keep them at a reasonable level. Please reach out here if you see any issues and I'll jump straight on it.

Seems to be better so far. Not sure on the auto clear as I removed them all in the CLI, but seems better since the update and will check again tomorrow.

adambirds commented 1 month ago

@mark-dr this appears to have fixed it, a day later and no large logs files any more. Not sure if you want to update the corresponding issues for windows too:

https://github.com/docker/for-win/issues/13926

cewkrupa commented 3 weeks ago

Hi @mark-dr,

Thanks for the prompt fix!

I wasn't even aware this was an issue for me until my coworkers pointed me to this thread and I discovered I do in fact have a ton of very large logs in ~/Library/Containers/com.docker.docker/Data/log/host.

I recently updated to Docker Desktop for Mac version 4.34.3 (170107). It appears that the electron log files are now generated at a reasonable rate and size; however they were not automatically cleared as you mentioned they should.

In this screenshot of the output of ls- l, you can see the size of the logs drop from ~20MB generated every minute to a few KB every hour or so around Oct 21 when I updated.

Image

I'm personally fine deleting these myself but I'm worried other users who didn't know they had this issue would know that they need to go delete stuff. Please let me know if there's any info I can provide that might help debug the auto clear!

mark-dr commented 3 weeks ago

Heya @cewkrupa, thanks for the info! I just checked and yep, sorry, it looks like I misspoke - the fix for creation of the log files is in 4.34.3, but the deletion of old ones got bumped to 4.35 (we try to reserve patch releases for particularly critical fixes, and at the time 4.35 was due to be released just a week or so later). 4.35 hit some delays, but we've worked through most (all? 🤞) of them, so I'm hopeful it'll land soon.

mark-dr commented 3 weeks ago

@cewkrupa: FYI v4.35.0 was released today. I appreciate you've probably manually cleaned up by now, but if not, the new version should do it for you 🙂

mark-dr commented 3 weeks ago

Closing as fixed (excessive logging fixed in v4.34.3, automatic cleanup in v4.35.0). As always, please let us know if it doesn't work for you or if you see regressions. Thanks for your patience with this issue, everyone 🙂