Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error response from daemon: driver failed programming external connectivity on endpoint #2722

Closed
2 tasks done
gitULuser opened this issue Oct 9, 2018 · 95 comments
Closed
2 tasks done

Comments

@gitULuser
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID:
    082AAF50-9E4F-494D-A533-A10EFE9F0A05/20181009115433

Expected behavior

Docker container runs.

Actual behavior

Getting an error message when issuing the run command:
"Program Files\Docker\Docker\Resources\bin\docker.exe:
Error response from daemon: driver failed programming external connectivity on endpoint test01 (3d48308d320a9c42b0d6583bb1add664f975cbb58f26c4ccb805a0287b019f66):
Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8080:tcp:172.17.0.2:80: input/output error."

Information

It is reproducible, but the error message is only displayed the first time.
After the initial time, there is no error message, but the container does not run. Details are shown as CREATED: 7 seconds ago STATUS: Exited (1) 6 seconds ago.
Tried restarting Docker, and also resetting to factory defaults.

  • Windows Version: Windows 10 Enterprise 1803 build 17134.286
  • Docker for Windows Version: 18.06.1-ce

Steps to reproduce the behavior

  1. Create the container.
  2. Run the container.
  3. Check to see if it is running.
@jasonwilliams
Copy link

jasonwilliams commented Oct 9, 2018

This is the same for me, its always the first time.
After i restart docker the second time it works

OS Name Microsoft Windows 10 Pro
Version 10.0.17134 Build 17134
Docker Version 2.0.0.0-beta1-win75 (19925)
Channel: edge
915f68b

Related: #1752
Related: #573
Related: #1038

Is anyone fixing this? There seem to be a few issues around the same problem?

@CodrinFaca
Copy link

Try disabling "Experimental Features" in the Settings/Daemon menu, restarting docker and then stopping all containers.

(worked for me. from: https://stackoverflow.com/questions/49693353/error-response-from-daemon-driver-failed-programming-external-connectivity-on-e?rq=1)

@jasonwilliams
Copy link

Properly shutting docker down before restart worked for me

@pd93
Copy link

pd93 commented Oct 15, 2018

Also related: #1967

@docker-robott
Copy link
Collaborator

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

@thomasvnl
Copy link

/remove-lifecycle stale

This is the same for me, its always the first time.
After i restart docker the second time it works

Same issue, also on Windows 10 Pro. After restarting docker, it works again.

@lbs-rodrigo
Copy link

I also restarted the docker on windows 10 and it worked.

@talaikis
Copy link

Yeah, restarting work. Docker version 18.09.1, build 4c52b90

@zanfilip
Copy link

I'd really like to see a solution other than restarting docker - which is disruptive. It would be preferable to have a command to release the process holding the lock on the endpoint despite the container being stopped. Is that possible?

@pd93
Copy link

pd93 commented Feb 15, 2019

@zanfilip This is caused by an incompatibility with Docker and fastboot. You can either make sure you stop all containers before shutting Windows down or you can disable fastboot in Windows' power settings by doing the following:

CTRL+R > "powercfg.cpl" > "Choose what the power buttons do" > "Change settings that are currently unavailable" > Deselect "Turn on fast start-up"

You can also disable fastboot with a single command in powershell if you're comfortable doing so:

Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power\' -Name HiberbootEnabled -Value 0

More info in #1967 as referenced earlier.

@FrankFang
Copy link

FrankFang commented Feb 22, 2019

@pd93 I prefer to restart docker instead of disabled fastboot. Because fastboot is cool : )

Finally, I switched to DockerToolBox.

@zanfilip
Copy link

zanfilip commented Feb 22, 2019

@pd93 Thanks for the informative suggestion but I have the issue each time I stop a container, not after restarting Windows.

I have to restart that container because it exposes 2 ports and often within minutes of being up the ports are no longer accessible (this is ibmcom/mq latest, in case anyone is interested). So the following commands give me the issue:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 69dfe4b24676 ibmcom/mq "runmqdevserver" 8 days ago Up About a minute 0.0.0.0:1414->1414/tcp, 0.0.0.0:9443->9443/tcp, 9157/tcp pensive_mcnulty
docker container stop pensive_mcnulty
docker start -ai pensive_mcnulty

$ docker start -ai pensive_mcnulty
Error response from daemon: driver failed programming external connectivity on endpoint pensive_mcnulty (ffe739bcbf738391180f26b04512d1b6edefbae489df69ca6fe9daf8b6675ebe): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:9443:tcp:172.17.0.2:9443: input/output error

@LBoraz
Copy link

LBoraz commented Mar 18, 2019

same issue on windows 10

@ghost
Copy link

ghost commented Apr 5, 2019

Well this does my head in.. every morning I turn my Windows 10 PC on, run my build command only to read :

Error response from daemon: driver failed programming external connectivity on endpoint sharp_lichterman (e88c95d64534c769171ed780db3ece823eafb1ddd5616c58d7334f766a8cd9c0): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:1533:tcp:172.17.0.2:1433: input/output error.

I shouldn't have to restart docker for desktop every morning and wait 10 years for it to come back up...
It's supposed to be an 'in' technology but man this is not efficient.

I'll be waiting for your fix! (ASAP I hope!)

@timgoeller
Copy link

Got the same problem right now, although it didn't happen the first time I restarted the machine, it started to show these problems after ~ a week.

@Touseef90
Copy link

Facing the same issue, at the first time. After I restart docker it works fine.
I was using this command "docker run --detach --publish 80:80 --name webserver nginx". On windows OS.

@LordGenry
Copy link

LordGenry commented Apr 25, 2019

Got the same issue.

docker run -p 3001:3001 -d $NAME

Solutions as:

  • disable fastboot
  • restarting docker
    -> are not really solutions, it's a duck-tape

Windows 10pro: 1809, 17763.379
docker desktop: 2.0.0.3 (31259), 8858db3

@sentinel09
Copy link

sentinel09 commented May 7, 2019

Started to experience this issue.
Worked great 1-1.5 week ago.

WIndows 10 Pro 17763
Docker: 18.09.2

P.S. system restart helped.

@dragonworx
Copy link

dragonworx commented May 23, 2019

I found restarting docker did fix it, but it was REALLY slow - too painful for any kind of enjoyable development...
I narrowed down the problem to containers which were killed by the user (Ctrl-C), they left running container processes around when you check with docker ps -a. Seemed to have trouble running over the top of them?
Killing all the running containers seems to work docker kill $(docker ps -q).
Then you can docker run... again without that error.
For basic development, its faster than waiting for docker to restart via GUI.

@shmocs
Copy link

shmocs commented Dec 11, 2019

No idea where is that json located for windows and if it works on windows (it should work)
I have 220+ containers on a server .. and restarting containers all at once - really kills the server

@NBardelot
Copy link

NBardelot commented Dec 11, 2019

On Windows the file is under $env:userprofile/.docker via Powershell (or %USERPROFILE%/.docker in a file explorer).

@meigallodixital
Copy link

In Windows Docker Desktop it is a virtualized application, not a service. When you stop it or restart it, the entire subsystem is supposedly 'cleaned' ...

I have set the parameter and comment if I notice that the problem is solved anyway :)

@aloani20
Copy link

On Windows 10, I tried the following command it solves the problem :
C:\WINDOWS\system32>net stop winnat

The Windows NAT Driver service was stopped successfully.

you may refer to the following issue for more details
#1804

thank you

@flyke
Copy link

flyke commented Dec 19, 2019

I have found a working solution for this error for Windows for my case.

My errors after trying lando start was:
Starting myproject_node_1 ... error
(the database, phpmyadmin and appserver started without problems)

a4bcc9ce0e879a28b08be93c8a25206100dc4530e91bcfbf): Error starting userland proxy: listen tcp 0.0.0.0:3000: bind: Only one usage of each socket address

ERROR: for node Cannot start service node: driver failed programming external connectivity on endpointmyproject_node_1 (bc83fa4623b66d59a4bcc9ce0e879a28b08be93c8a25206100dc4530e91bcfbf): Error starting userland proxy: listen tcp 0.0.0.0:3000: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.

ERROR: Encountered errors while bringing up the project.

And that repeated a few times.
I know that restarting my pc usually fix this, but as a web developer that uses Docker and Lando everyday, I needed a solution to fix this without restarting my pc.
Closing docker and terminating the docker service did not work.
Adding "live-restore": true in C:\Users\myusername.docker\config.json and restarting docker did not work.
Running command net stop winnat did not work.

ACTUAL WORKING SOLUTION:
error message clearly shows in this case a problem with trying to use port 3000.
So what you need to to is find whatever is hogging that port and kill it:

netstat -ano | findstr :3000

gives you a list of what exactly is using your port 3000:

TCP    0.0.0.0:3000       0.0.0.0:0           LISTENING         18420
TCP    [::]:3000              [::]:0                 LISTENING         18420
TCP    [::1]:3000            [::1]:62760       ESTABLISHED     18420
TCP    [::1]:62760          [::1]:3000         ESTABLISHED     15032

The last column is the PID (process id) that is using your port 3000. In this case: 18420 and 15032.

You can terminate those processes like this (works for me in git bash):

taskkill -F //PID 18420 //PID 15032

After this: lando start starts up without errors and all is working well

@AndriLaksono
Copy link

I just restart my PC (Win 10 Pro) and solved my case.

Or you can check your proxy with netstat -ano and see what's run.
Kill that process.

@aprabhat
Copy link

I am getting the same error while running the docker container on docker desktop using

docker run -p 8081:8081 {{image}}

To check which application is using the port 8081 I used below powershell command

Get-Process -Id (Get-NetTCPConnection -LocalPort 8081).OwningProcess

which result in

Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName


596      36  1378632      76916      39.83  29480   1 javaw

which is showing javaw process is running on 8081

After killing the process using

taskkill /F /PID 29480

And everything is back to normal without restarting the docker desktop.

@doggy8088
Copy link

Restart docker service saved me.

net stop docker
net start docker

@krisyupher
Copy link

add the -i option and it seems to work correctly

docker run -d -i -p 8084:80 nginx

@jacksonStone
Copy link

This is an issue for Docker for Mac as well. Same kind of error. Issue must be pretty gnarly if it's been around for nearly two years now. Some strange song and dance of restarting Docker a few times, killing the PID on the portt or restarting Mac is required to get things up again.

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days 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

@natefrisch01
Copy link

/remove-lifecycle stale

@dimat
Copy link

dimat commented Jul 15, 2020

I had this issue on macOS. Tried to restart the computer, stopped and killed all the containers, and even did docker system prune -a, still nothing worked.

Since in macOS Docker is running on a virtual machine, I thought that restarting the virtual machine would help.

What I did was, just went to the Docker preferences, Resources and changed any setting (CPU or Memory). Then after applying the change it restarted the virtual machine and started working.

I guess at some point some old container didn't release all resources and was still holding the port which wasn't possible to detect from the macOS host machine.

@Pomax
Copy link

Pomax commented Oct 8, 2020

@dimat this is the repo for Docker for Windows.

@jersonmartinez
Copy link

Expose ports isn't working. For ex. apply: docker run -dt --name app02 -p 8080:8080 appimage

@Pomax
Copy link

Pomax commented Nov 5, 2020

@jersonmartinez that sounds like it has nothing to do with this issue: you probably want to file a new issue explaining your setup and what problem you're experiencing.

@dwivedithedev
Copy link

Restarting docker seems to work.

@Slisarenko
Copy link

/etc/init.d/redis-server stop
I'm using docker, in my case, It helped me

@krsaurabh2006
Copy link

krsaurabh2006 commented Dec 28, 2020

Instead of restarting the docker you can run below commands
docker ps //This will list down all the processes running
docker stop //This will stop the process

Now you can rerun the commands

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days 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

@Vespira
Copy link

Vespira commented Apr 20, 2021

I remember having this issue a long time ago with Docker for Windows old-fashionned way (Docker Engine on Hyper-V). The culprit was the fastboot of Windows 10, that messed up Docker networks when restarting computer; so you had to recreate your Docker networks to fix it.

But never had this issue again with Docker v20.10.5 on WSL2, and last response is from last year, so I guess we could close it ?

@docker-robott
Copy link
Collaborator

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

@docker docker locked and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests