docker / for-mac

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

Daemon fails with "Failed to set posix_spawn_file_actions for fd -1 at index 0 with errno 9" #3473

Closed marcelloromani closed 4 years ago

marcelloromani commented 5 years ago

Expected behavior

docker-compose running as usual

Actual behavior

docker-compose runs starts the expected containers but crashes at random times with the following error message:

ERRO[0028] error waiting for container: EOF
ERROR: Bad response from Docker engine

When this happens, the docker daemon seems to have crashed: the icon in the tray bar at the top of the screen disappears and any further attempts to execute docker or docker-compose fail with the "can't connect to daemon" error message.

Information

Diagnostic logs

Docker for Mac: version...
Version 2.0.0.2 (30215)
Channel: stable
0b030e17ca

Log messages from the Console app:

fault   11:58:50.192474 +0000   Docker  CrashReport: report: Failed to set posix_spawn_file_actions for fd -1 at index 0 with errno 9
error   11:58:50.418321 +0000   Docker  failed to read /System/Library/Preferences/Logging/Subsystems/com.apple.SystemConfiguration.plist: [24: Too many open files]
error   11:58:50.418365 +0000   Docker  failed to read /Library/Preferences/Logging/Subsystems/com.apple.SystemConfiguration.plist: [24: Too many open files]
default 11:58:50.419019 +0000   Docker  dnssd_clientstub ConnectToServer: socket failed 24 Too many open files
error   11:58:50.419427 +0000   Docker  nw_resolver_create_dns_service_locked DNSServiceCreateDelegateConnection failed: NoMemory(-65539)
error   11:58:50.453132 +0000   Docker  CrashReport: The operation couldn\U2019t be completed. (NSCocoaErrorDomain error 256.)

Steps to reproduce the behavior

marcelloromani commented 5 years ago

Reporting this made me focus on something I had overlooked at first:

dnssd_clientstub ConnectToServer: socket failed 24 Too many open files

After a bit of research on this I found: https://github.com/mogui/MDWamp/issues/42 which in turn points to https://forums.developer.apple.com/message/118647#118647

It seems like Docker itself is opening a lot of fds thus leading to the crash.

Docker Desktop for Mac unusable for me at the moment.

vhf commented 5 years ago

I'm having the exact same issue. I couldn't get a diagnostic because Docker for mac crashes before generating the diagnostic.

marcelloromani commented 5 years ago

As an FYI for anyone reading, this is a showstopper for me at the moment, so I went back to docker-machine which has worked reliably so far despite using the same version of the docker engine as Docker Desktop.

This made me think the issue is with the Mac OS integration, not docker engine itself (bear in mind this is just speculation on my part).

ivangorbachev commented 5 years ago

I've got the same issue after updating macos to 10.14.3 (18D109). Is there any estimation on when it'll be fixed or maybe there's a workaround?

simula67 commented 5 years ago

Facing same issue for me also

marcelloromani commented 5 years ago

Installed Docker for Mac Version 2.0.0.3 (31259)

I haven't seen the issue since then.

sameergarg commented 5 years ago

I am seeing this issue for Version 2.0.0.3 (31259)

floralWallpaper commented 5 years ago

Not sure if this will help anyone, but I had changed the password on my machine without restarting and I think this was potentially the cause of it. After restarting my mac, docker started working.

yolossn commented 5 years ago

Facing same issue in Version 2.0.0.3

marcelloromani commented 5 years ago

I'm wondering if this error is in some (obscure) way related to https://github.com/docker/for-mac/issues/3557#issuecomment-502324468

docker-robott commented 5 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

kxxoling commented 5 years ago

Meet this issue while upgrade my Macbook to macOS 10.15. Seems it's all right now after uninstalling and reinstalled Docker for Mac.

glyph commented 5 years ago

Had this same issue a little while after updating to Catalina. Also can't generate diagnostics because the UI to do it is obscured. It's happening with both edge and stable (started on Edge, downgraded to stable), after a factory reset and a manual factory reset (deleting Library/Containers/com.docker.docker/Data and ~/.docker entirely.)

Going to try

marcelloromani commented 5 years ago

Update: I'm not seeing the bug any more since installing: Docker desktop 2.1.0.4 (39773) macOS: 10.14.6 (18G103)

Will reopen if I see the bug again.

Andremoniy commented 4 years ago

It started happen again when trying to update Docker on MacOS Catalina (10.15.2 (19C57)). The current version of the Docker is 2.1.0.5, trying to update to 2.2.0.0.

UPDATE: Actually this error is shown regardless whether I am trying to install an update or just trying to start docker.

ed0906 commented 4 years ago

I am having the same issue as @Andremoniy I uninstalled and downloaded the latest version which didn't help

Docker version: 2.2.0.4 Engine version 19.03.8 OS: Catalina 10.15.3

superman-lopez commented 4 years ago

Docker version 19.03.8, build afacb8b OS: Catalina 10.15.3

Same problem

tgsmith61591 commented 4 years ago

@marcelloromani is it worth leaving this open as so many others continue to have this issue?

gvazqu1 commented 4 years ago

I'm having same issue, started today

docker: 2.2.0.5 os: 10.15.4

donvito commented 4 years ago

I am getting this error just now and docker won't even start. Any ideas how to resolve this?

Catalina 10.15.3 I got the latest version from https://hub.docker.com/editions/community/docker-ce-desktop-mac

[Update] This worked for me https://github.com/docker/for-mac/issues/4566#issuecomment-628663357

marcelloromani commented 4 years ago

Haven't seen the issue myself for a while, but reopening as it seems to affect quite a lot of people.

abhayverma commented 4 years ago

[UPDATE] After restarting the machine the issue was fixed. Facing this issue from yesterday. How do you fix it? Docker version: 2.2.0.4 Engine version 19.03.8 Mac OS: Mojave 10.14.6

ed0906 commented 4 years ago

I got rid of this error by restarting my machine. I’m guessing a file handle gets locked or something

curtisdf commented 4 years ago

I mysteriously began seeing this error today. I don't know what I did because I didn't install any upgrades to anything, and although I was using Docker as normal (software development), same as I have been for years, I wasn't mucking with settings or doing anything unusual.

Restarting my machine did NOT help. I got the error immediately upon booting up and logging into my desktop.

My Docker version is 2.3.0.3. While Docker is booting (but before the error appears), I'm able to do the Check for Updates option, and it says this is the latest version. This is on my MBP running Catalina (10.15.5). I've also applied all available MacOS updates.

[UPDATE: It had been awhile since my Docker disk space had filled up, so I looked and found that my ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw was 64 GB in size. I deleted it and then restarted the Docker daemon, as I've always done in the past whenever I get disk space errors related to Docker. This seems to have solved it.]

seohyun0120 commented 4 years ago

Hi, I am facing same issue here. Docker desktop : 2.3.0.3 (45519) Docker engine: 19.03.8 Mac OS: Catalina 10.15.5

I also tried reinstalling and restarting docker desktop but shows the same error.

ArseniyBorezkiy commented 4 years ago

I have the same issue: Docker version 19.03.8, build afacb8b Mac OS: Catalina 10.15.5 (and not only last this last version, 3 month before updated version too had his error after docker updates in background). Docker reinstallation doest helps.

anil-roy commented 4 years ago

In my case

This file ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw

is listed as 64GB. But it is a sparse file that reserves a quota but doesn't actually use all that space. It can grow to that size. 

But when I did: du -h Docker.raw

It shows up as 56GB

By doing: docker system prune

I ended up deleting a lot of cruff that was occupying "real" bytes on the disk. And the update then just worked without any issues.

warrenronsiek commented 4 years ago

Seeing the same thing, docker version 2.3.0.4, MacOS 10.14.6.

lsof_docker_1598282633.log     1860
lsof_docker_1598282678.log     2735
lsof_docker_1598282725.log     3620
lsof_docker_1598282773.log     4501
lsof_docker_1598282804.log       29 << crash
lsof_docker_1598282825.log        4
lsof_docker_1598282847.log        4
lsof_docker_1598282872.log        4
lsof_docker_1598282889.log        4
lsof_docker_1598282910.log       14
lsof_docker_1598282938.log       84
lsof_docker_1598282993.log     1045
lsof_docker_1598283036.log     1803
lsof_docker_1598283077.log     2605
lsof_docker_1598283121.log     3424
lsof_docker_1598283155.log     4076
lsof_docker_1598283204.log     5127
lsof_docker_1598283234.log        5 << crash
jeremysf commented 4 years ago

I'm seeing this too. Pruning did not help. Also, when I get the "Fatal Error" dialog box, weirdly, as long as I don't close the dialog box, I can continue to use docker, but of course, if I click "Exit" then it quits docker.

docker-robott commented 4 years ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked