I am getting the error “docker: Error response from daemon: connection error: desc = “transport: dial unix /var/run/docker/containerd/docker-containerd.sock: connect: connection refused”: unknown.” when trying to restart existing containers, run new containers, docker top, docker exec, and probably more commands I have not listed. I also only dashes when I do docker stats. I can list containers and see they are running and I am able to use the apps on the containers as expected. Any thoughts?
I appear to have started also also not having docker be able to delete some containers after they finished running.
Log messages like
Jan 5 14:59:53 dockerd: time=“2018-01-05T14:59:53.067411517-05:00” level=error msg=“Failed to remove container fc78917e0612f0a81be9210fac5cdc21e3534ea13af468ab4f1b214ceead1afb: N
o such container: fc78917e0612f0a81be9210fac5cdc21e3534ea13af468ab4f1b214ceead1afb”
I have this sumologic container with /var/run/docker.sock:/var/run/docker.sock as a volume. That container had been running for about a week before these problems started.
I am getting the same error.
The problem is the /var/run/docker is not accessible from the current login user in ubuntu. That’s why it could not connect to the container. And throwing the connection refused error.
Restarting docker of course clears the problem, but only temporarily. I am several restarts deep and hoping not to have to do it anymore. The nature of docker for mac means restarts probably take much longer than the pure linux experience.
Has anyone found a solution for this?? My company uses docker on the mac for local testing of container networking before they are pushed to AWS for hosting. The problem with local testing is, there is absolutely no excuse for my cpu usage to skyrocket to over 410% and sound like my mac is about to take off through the window…I am simply trying to test my oplog-monitor but each time I spin up my elasticsearch container, everything gets loud, fails, and now I’m 6 restarts deep with no progress and no solution.
I was getting this error on my Mac, 10.12.6, Docker 17.?.? (upgraded to 18.03.0-ce-mac59 (23608) in attempt to fix, with no luck). Also was getting CPU bound when this happened…
Figured out I didn’t have enough memory allocated to Docker (Preferences->Advanced->Memory).
Details: The condition arose over a month after I had granted a DIND container max of 2G, and Docker overall was set to max of 2G. When the container finally started needing somewhere above 700M, the disconnect/CPU-bound condition would arise. Nothing but restarting Docker would fix it. I haven’t seen the condition since I allocated 8G memory to Docker.
UPDATE:
I found this happening again after installing an update to my Mac OS (assuming it’s similar cause for others).
My Best assumption is bad sockets, and connections for docker images. So updating docker is not the issue, it’s the connections and sockets on your OS.
The solution that worked for me everytime was the following (mac):
~ docker ps --all
//shows all background images still processing
~ docker-compose down
//shut down any compose safely
~ docker system prune -a
~ docker ps --all
//should be empty
~ docker images
~ docker rmi -f { container_id_1 container_id_2 container_id_3 }
// all containers listed with a space between them
~ docker images
//should be empty
restart docker
Now you should be able to rebuild your images with no problem (since all sockets are new).