cannot connect to docker instance

Posted October 12, 2021 101 views

I am getting the below error when trying to log onto to a running docker instance and cannot log on.

docker exec -it <my_container_id> /bin/bash

connection error: desc = “transport: dial unix /var/run/docker/containerd/docker-containerd.sock: connect: connection refused”: unknown

1 comment
  • Part of this issue is that I started a task overnight which raised the CPU to 100% for the past several hours, so I may be getting locked out until the internal process times out in some way, not sure when. Got the same error when trying ‘docker stop <my_container_id>’ If this is CPU max-related then would be interested if any way to throttle the CPU at something less than max to allow login.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I would recommend trying to restart the Docker service:

systemctl restart docker

Let me know how it goes.

  • Thanks, I will try this if the instance does not resolve itself by the end of the day. The instance is still running my webite ok, I only cannot login and can wait to see if it resolves. I’m concerned in restarting docker, I may lose process state, etc since my last backup or other issues with taking that step.

  • The above recommendation worked and marking as accepted answer. I was hesitant to try for fear of losing previous state or data, but after seeing the server instance maxing out CPU for over a day and still not able to login I tried the above recommendation and after stopping and starting my two docker processes (webserver and database) everything seemed fine with no loss of state or data since the last login. When I tried to login initially after the docker restart I got the below error on the 2 processes which again went away after I stopped and restarted the processes(docker stop <id>, docker start <id>).


    root@docker-flapp-01:~# docker exec -it <my_container_id> /bin/bash
    OCI runtime exec failed: exec failed: containerlinux.go:296: starting container process caused “processlinux.go:78: starting setns process caused "fork/exec /proc/self/exe: no such file or directory"”: unknown