abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.77k stars 397 forks source link

Containers crash with error EOF #710

Open edwinwijaya94 opened 1 year ago

edwinwijaya94 commented 1 year ago

Description

When running multiple containers using colima, sometimes they are terminated suddenly with following EOF errors:

error during connect: Get "http://%2FUsers%2Fuser%2F.colima%2Fdefault%2Fdocker.sock/v1.24/containers/7a/json": EOF

Following is similar errors which also happen before the containers stop suddenly:

Unexpected EOF

The issue happens intermittently, but seems more frequent when running several containers (>10) at the same time.

Version

Colima Version: 0.5.4 Lima Version: 0.15.1 Qemu Version: 8.0.0

Operating System

Output of colima status

INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/user/.colima/default/docker.sock

Reproduction Steps

  1. Run several docker images as containers
  2. Wait for few minutes
  3. Some containers are suddenly stopped with EOF error

Expected behaviour

containers can run as usual and not stopped suddenly

Additional context

No response

MadsRC commented 1 year ago

I've been running into similar issues, just on x86 - I solved it by adding more CPU, memory and disk space for the VM running colima

yihuang commented 9 months ago

I have the same issue, the container don't crash, just docker docker can't connect, colima ssh.

$ docker --version
Docker version 24.0.5, build v24.0.5
$ colima --version
colima version 0.6.8
$ colima status
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/user/.colima/default/docker.sock
rfay commented 9 months ago

We recently had the class of problem described in the original issue here, where docker would get an EOF from Colima.

It turned out that our code had created dozens of docker api connections and not closed them. Colima has some kind of limit, where it stops responding after that and does not proxy the docker API call inside the VM..

You can see if this is your problem like this: If on the host, docker ps (or whatever your app is doing) gets and EOF, try it inside the Colima VM. So colima ssh and docker ps in this case. If it works inside the VM, but not outside, you may have this problem.

yihuang commented 9 months ago

try it inside the Colima VM

thanks for the suggestion.

In my case, sudo chmod 666 /var/run/docker.sock inside the vm (colima ssh) do the trick.

shinzui commented 9 months ago

In my case, sudo chmod 666 /var/run/docker.sock inside the vm (colima ssh) do the trick.

That fixed it for me, also. Did something change requiring that?

jakekreider commented 8 months ago

In my case, sudo chmod 666 /var/run/docker.sock inside the vm (colima ssh) do the trick.

That fixed it for me, also. Did something change requiring that?

Same here, used Colima for a while now but never had this issue before today.

takirala commented 6 months ago

In my case, sudo chmod 666 /var/run/docker.sock inside the vm (colima ssh) do the trick.

That fixed it for me, also. Did something change requiring that?

Same here, used Colima for a while now but never had this issue before today.

Same here as well, colima hung after upgrade and chmod fixed for me.

rhysjohns commented 5 months ago

In my case, sudo chmod 666 /var/run/docker.sock inside the vm (colima ssh) do the trick.

Just jumping in here to give this a bump - we had this issue on an M3 machine in our org for a while now, and running this solved it.

Would love to know the root cause of why this is happening, but this helps a lot regardless.

Olnexia commented 5 months ago

try it inside the Colima VM

thanks for the suggestion.

In my case, sudo chmod 666 /var/run/docker.sock inside the vm (colima ssh) do the trick.

That did not work for me running on M3. I wonder what was the background behind this solution.

pecigonzalo commented 5 months ago

I tried that chmod trick and it worked for me, but I had to do it on every restart. This did not use to be required. I also wonder what is the context on this issue, requiring that change.

igor-petrik-invitae commented 3 months ago

Installing --HEAD as suggested in https://github.com/abiosoft/colima/issues/987 solved this issue for me - I don't quite understand what the difference is between HEAD, and the most recent release last week. This has apparently been an issue for over a year, why is the fix still in HEAD and not yet made it into a release?

abiosoft commented 3 months ago

@igor-petrik-invitae that must've been a coincidence. There is no tangible difference between the current HEAD and last week's release.

igor-petrik-invitae commented 3 months ago

It seems like installing HEAD forced it to install a new version of lima, something that just plain brew install colima didn't do.

kristjankoppel commented 3 months ago

This is happening to me also. What is the latest situation on this topic? Should Colima be updated to latest version or what is the permanent fix for that bug?

Hepzik commented 3 months ago

I am trying to get a vm for Mac OS m1 using Colima to get oracle db installed. I used brew install colima docker But Colima status gives FATA[0000] error retrieving current runtime: empty value and it looks like docker is not even installed. Can someone help identify the issue for me and suggest a fix?