Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot restart Docker container due to input/output error?

I noticed my Redis instance on my local pc stopped working. I use Docker to host it and tried to issue a restart command on the container as ps stated it was running*.

docker restart my-redis

However this yielded the following error message:

Error response from daemon: Cannot restart container my-redis: driver failed programming external connectivity on endpoint my-redis (...): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:32777:tcp:172.17.0.2:6379: input/output error

*I've been running a DNS server on the same machine where I run Docker. There is a service started when my PC boots which also listens at port 53. I need to shut down this process in order for my DNS server to boot up properly. I suspect this is a process used by Docker and as a result it might be able to start up the container initially, but fails when issued a restart (because of that process being shut down).

I already set up Docker to use my local DNS server (under Settings -> Network in Docker for Windows), but I'm not really sure if this is at all related to the input/output error that breaks my container.

like image 663
Ropstah Avatar asked Jan 06 '18 17:01

Ropstah


People also ask

How do I restart a docker container on failure?

no: Containers will not restart automatically. on-failure[:max-retries]: Restart the container if it exits with a non-zero exit code and provide a maximum number of attempts for the Docker daemon to restart the container. always: Always restart the container if it stops.

Can you restart a docker container?

Docker also lets the user set the restart policy upon exit or failure. Users can type docker ps to check if the restart policy is active; it will be shown as either Up , when the container is up and running, or Restarting when the container is in the restart state.

How do I resume a docker container?

Enter the docker start command with the Container ID in the command line to resume the Container. Note: This preserves environment variables set during the initial docker run statement.


2 Answers

The problem seems to have happened for many(usually on Windows) and not solved clearly. Refer this issue.

However, there would be a temporary method to solve it, which is disabling experimental features(in the above issue, many are saying it is solved after disabling experimental features).

I am not sure how to disable it and which OS you are using but you could easily google to find how to disable it for the OS.

like image 107
SangminKim Avatar answered Nov 15 '22 03:11

SangminKim


Um been happening for me also - was about to write a post. I had created a weblogic container yesterday and stopped started it several times in day ok ( no overnight reboot)

cam to try and start today and got this error on my windows 10 main machine

Error response from daemon: driver failed programming external connectivity on endpoint wls (dd11b7bd7d23df50651a94eec68cdd2ec59e160d9c4ae8caa682f0a037218393): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:9002:tcp:172.17.0.2:9002: input/output error

where the docker ports is showing tcp:172.17.0.2

This has happended before after overnight shut down and restart on fresh day on my windows desktop, even though docker said it was running ok

I ignored that and just told it to restart, and tried the docker start again and it worked

when you do a docker ps -all now it shows

ports: 0.0.0.0:7001->7001/tcp, 0.0.0.0:9002->9002/tcp which indicates its working again

so something spooky going on under the covers in network mappings - weird

13/03/2019

like image 22
WILLIAM WOODMAN Avatar answered Nov 15 '22 04:11

WILLIAM WOODMAN