compose: "driver failed programming external connectivity on endpoint" (1.7.0-rc1)
I’m pretty sure this was working on docker-compose 1.7.0-rc1 before I installed the latest Docker for Mac beta, which upgraded to docker 1.11.0-rc3. I’m trying to get the socat service to run on port 172.17.0.1:8123, so that it’s available to docker builds. My real yml uses an environment variable for the IP address, but it happens even when hardcoded.
ERROR: for socat_httpcache driver failed programming external connectivity on endpoint test_socat_httpcache_1 (5d973ed559d63a5561b715248f797a336915a44960b5e32e622ac8349b16e5d2): Error starting userland proxy: failed to bind port: Unix.Unix_error(Unix.EADDRNOTAVAIL, "bind", "")
version: '2'
services:
httpcache:
restart: always
image: clue/polipo
command: proxyAddress=0.0.0.0 allowedClients=0.0.0.0/0 disableIndexing=false disableServersList=false
mem_limit: 500m
memswap_limit: 500m
volumes:
- /var/cache/polipo
socat_httpcache:
restart: always
hostname: POLIPO1
image: bobrik/socat
mem_limit: 50m
command: TCP-LISTEN:8123,fork,reuseaddr TCP:httpcache:8123
depends_on:
- httpcache
ports:
- "172.17.0.1:8123:8123"
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 123
- Comments: 305 (2 by maintainers)
Links to this issue
Commits related to this issue
- hostnet: convert Uwt errors to Unix_errors, pretty-print "expected" cases Previously we lacked a function to convert from Uwt.error to Unix.error. Happily uwt.0.0.3 contains such a useful error conve... — committed to djs55/vpnkit by djs55 8 years ago
- hostnet: convert Uwt errors to Unix_errors, pretty-print "expected" cases Previously we lacked a function to convert from Uwt.error to Unix.error. Happily uwt.0.0.3 contains such a useful error conve... — committed to djs55/vpnkit by djs55 8 years ago
- hostnet: convert Uwt errors to Unix_errors, pretty-print "expected" cases Previously we lacked a function to convert from Uwt.error to Unix.error. Happily uwt.0.0.3 contains such a useful error conve... — committed to djs55/vpnkit by djs55 8 years ago
Please stop sending +1, as it spams all subscriber inboxes. Either use the emoticons (smiley on the right of each comment) or at least give your full setup, version numbers and so on. Thx
on osx the built-in apache web server may be running on ports 80/443. To check: ps -ef | grep httpd
To turn it off: sudo apachectl stop
@jamshid Can you post the o/p of
sudo netstat -nlp | grep 8123
. Thanks.Sometimes
docker-compose
fails to start the desired container and leaves the port occupied with a process listening… so try listing all the (listening) ports usingUPDATE: I was also able to reproduce this issue (multiple times)… start a service locally that is listening to port
XXX
and start a container that exposes the sameXXX
port… it’ll fail to rundocker-compose up
and thecom.docker.slirp
process will not be killed causing the problem to persist till thecom.docker.slirp
process killed manually ( I even added an alias to do soalias portfix='pkill com.docker.slirp'
)It seems there are many flavours of this issue. Here’s mine:
Docker for Windows on Windows 10.
It seems the latest Windows 10 update (Fall Creators Update, 2017) has a new “feature”. When you shutdown it remembers what’s running so it can start them back up for you when you restart.
This wrecks havoc with Docker for Windows (and erased several hours of my time before I made the connection). Got the dreaded “driver failed programming external connectivity on endpoint” when trying to re-up my docker-compose.
Turns out, in this case, simply restarting Docker solves it. Didn’t find that right away, because I restarted the computer. Thinking this would also restart Docker. No - it reconstituted Docker in a bad state.
There appears to be no way to turn off this new feature of Win10. https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_perf-insiderplat_pc/programs-autostart-after-boot-in-windows-10-fall/09dd8d3e-7b36-45d1-9181-6587dd5d53ab
Instead, to shutdown “properly” we are forced to run this from command prompt: shutdown /s /t 0 or restart Docker when I forget to do this.
This solved my issue on windows :
docker-compose down
docker-compose up
@tsantos84 Docker will be running inside a VM when you’re using Docker for Mac.
Try the following (I haven’t tested this though):
docker rm -f $(docker ps -aq)
(will remove all of your containers)docker network rm $(docker network ls -q)
(will remove all of your networks)docker run --rm -v /var/lib/docker/network/files:/network busybox rm /network/local-kv.db
Then restart Docker for Mac and you should be good to go 👍
Hello, I had the same problem with Docker version 1.11.1 on Mac OSX.
ERROR: for nginx driver failed programming external connectivity on endpoint managercentralapp_nginx_1 (e11d19ee8f486a2e12c9c87802dca7ea5f541f026645f69e338e94732ac1eb56): Error starting userland proxy: Failed to bind: EADDRINUSE
Just Restart Docker. It worked for me.
same thing happening to me.
THANK YOU! HOLY FK, I SPENT A WHOLE DAY TRYING TO FIX THIS.
THE YEAR IS 2020, THAT’S 4 YEARS AND THIS PROBLEM STILL EXISTS. WTF
3 years and this bug is still alive and well…
+1 on mac 😦
+1 on Mac
+1 same problem on the mac with docker for mac
I am getting the same issue when restarting using docker-compose up. In my case it’s an nginx proxy service that fails to start. Must be related to the Docker for Mac beta. It started after I installed the beta and hasn’t happened after switching back over to Virtualbox.
docker-compose version 1.7.0, build 0d7bf73 Docker version 1.11.0, build 4dc5990
for me a manual restart of docker made it work
Using docker for mac, in my case removing all containers and killing docker process occupying the ports were not enough to fix the issue. I had to remove the networks associated with those ports as well.
stop & remove docker containers:
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker volume rm $(docker volume ls -qf dangling=true)
remove problematic networks:
docker network rm(docker network ls -q)
find out which process occupies the port
lsof -nP | grep LISTEN
examine the output of last command and kill the process occupying the port (see @mad-raz 's post on how to do that). Following these steps fixed the issue for me.
Found this thread, and none of the above helped me.
I am running Ubuntu and I had to use:
sudo service docker restart
I tried prune and all the other commands and docker was sure it had nothing running, but after restarting the service, it all started working again.
Found solution for people with same error as I shown above. I was previously using Docker Toolbox, but I did not delete Virtualbox. It was using my ports so I can not start. After complete removing VirtualBox,
docker-compose
worked awesome.@aanand @dnephin please, add to
Getting Started
a warning like explained above.My mac says
-p
requires an argument, so I think this is what you want:follow madjam002 's method got this solved.
I had a similar problem Docker for Mac running nginx container, my port 80 was being used by apache (native). I used telnet and netstat to see the running service.
If anyone using Docker Desktop Follow Below steps : (Avoid Restarting Docker Desktop)
restart docker work for me. on windows 10
Same problem here. FIXED WHEN I restarted Docker, and the ports were released - sorted
To solve the following error in Windows Restart Docker (from tray menu or selecting the ‘Restart Docker…’ option in Settings/Reset)
Cannot start service YOUR_SERVICE: driver failed programming external connectivity on endpoint
Restarting docker works
I figure out what the problem is about, the container (consul) causing the issue has this binding port
172.17.0.1:53:8600/udp
. I replaced it with53:8600/udp
and it’s working now. I didn’t understand yet why the first binding doesn’t work. BTW, How can I know the bridge ip address?this is what finally worked for me on my mac:
sudo /usr/sbin/apachectl stop
you can then tell that httpd is not there by runningps -ef | grep httpd
I had this happening after a move to
Docker for Mac
, but after stopping and removing All containers after the move, restarting docker, recreating container etc etc. It was fixed.I had this again today after an update of
Docker for Mac
, but repeating the above scenario fixed. I assume the port (and “other” things) I’m assigning to particular containers is not being released until completely cleaned up.eg:
ERROR: for nginx driver failed programming external connectivity on endpoint dev_nginx (4c340c55f7402c7b265803ea64541ebdf8613f4b43dfa816001d27bdc4f513b3): Error iptables FORWARD: Another app is currently holding the xtables lock; waiting (1s) for it to exit... ERROR: Encountered errors while bringing up the project.
Restart Docker…just that
I had the same error message and I restarted Docker on Windows. It did the trick.
Restart Docker works for me. (Docker for Windows,
Docker version 18.06.1-ce, build e68fc7a
)Simply restarting docker fixes this issue for me.
I’m seeing this sporadically. Retrying the command after a minute usually “fixes” the problem. This is after moving to Docker for Mac yesterday.
Restart docker works for me
+1 Same error on mac
Full error:
netstat:
I encouner the same error when I try to start my stack using docker-compose. All the containers start correctly except one (consul). I’m getting this error
ERROR: for consul driver failed programming external connectivity on endpoint devas_consul_1 (6ceba32c51cb70b354f 2f4b68d173ca97a65d6a0bfd308d3137e2a7069abd1b6): Error starting userland proxy: Failed to bind: EADDRNOTAVAIL
I’m sure it has something to do with my docker version beta for mac.
docker-compose -v docker-compose version 1.7.0, build 0d7bf73
I’m using the last docker beta version for mac
` docker version Client: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 5604cbe Built: Wed Apr 27 00:34:20 2016 OS/Arch: darwin/amd64
Server: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 8b63c77 Built: Fri Apr 29 14:13:26 2016 OS/Arch: linux/amd64 `
I need to restart docker every day… would really love to get this fixed!
This worked for me as well.
If you have MAC, try to stop server. I have apache. sudo /usr/sbin/apachectl stop
Following the above message, I get
Error starting userland proxy: Failed to bind: EADDRINUSE.
Confused as to where the conflict is where none existed beforerestart docker can resolve everything, that because restart docker would clean up all the running container.
I check my docker compose.yml file again, and delete the container which located inside the docker-compose.yml file either, and no need to restart the docker.
enjoy.
it help me by reset Docker.
Restarting docker (via “Restart” command or manually quitting and re-launching) did NOT work for me.
I’ve had pretty same issue, with Docker for Mac, running postgresql container. So, for me it was caused by postgres running on same port on host system as port specified in my compose config file. Pretty obvious thing, but could be helpful for someone I guess. Thanks for cool tool. 👍
I was also facing the same problem but after a long time a meet with the perfect solution
I am getting this issue pretty regularly(on windows ) and restarting Docker solves the problem.
my solution was -> Reset Docker to factory defaults
same issue Windows 10
On MAC stop internal apache
sudo apachectl stop
If you’re on a Mac and your docker web server won’t start, it might be File Sharing - Apple uses the built-in Apache for that. Either…
or better yet, turn off file sharing.
@yedincisenol yes, but having to restart every day is a bit annoying
Sorry to be that guy, but at my machine, rebooting the computer was the solution. Docker restart did not help.
For windows users: Disable “fast startup” in your power settings and it works! https://stackoverflow.com/a/47818614
Ubuntu 18.04, restarting docker solve the problem
To add to Ray-Eldath’s comment: I was confused because restarting my computer twice didn’t work (same version: 18.06.1-ce for Windows), and surely restarting your computer is enough to count as restarting Docker too, right? So I guess restarting didn’t fix it, right? Well, no, lol. I actually go to Docker and click “Restart” and now it works.
EDIT: Oh, interesting, now I know why this happened (probably). Restarting my computer actually created this problem I think. Check this out:
https://stackoverflow.com/questions/40668908/running-docker-for-windows-error-when-exposing-ports
Relevant quote:
Given that, I’m still suspect of the 18.06.1-ce Windows update, since this wasn’t a problem for me until I updated to that.
Encountered the problem on windows. Fails on any service any port, restarting docker fixed it.
Thank you! It helped me to quickly solve the problem.
Tried the above without success. I got it working by wiping my entire docker cache via running:
docker ps -aq | xargs docker rm -f && \ docker images -q | xargs docker rmi -f && \ docker volume list -q | xargs docker volume rm -f
First, upgrade windows 10 to 1809. Then, turn off “Start Docker desktop when you log in” in the docker setting. Finally, start the docker manually (you don’t have to restart). The problem has gone and it is working well in my computer.
I was also facing the same Problem. I resolved It by restarting the docker. Guys, I see that some time the virtual machine may be occupied with the same ports what you are running now. So, by restarting the docker you can resolve this problem.
Was facing this issue right now on linux.
systemctl restart docker
fixed it for me.Well, I’m using docker engine 1.11.2 in centos7 in a Continuous Build/Integration flow to automate tests and as far as I can tell, eventually this error pops up even though no container is running (while re-deploying a specific version of the whole service stack). Also it seems related to the fact that sometimes docker engine gets an error on trying to cleanup after the removal of running containers, and some iptables rules might be kept allocating network ports for some reason, maybe related to https://github.com/docker/docker/issues/23371#issuecomment-229982105 - but I’m still not sure about that.
Just had encountered the same issue complaining about a Postgres container. Curiously, exiting Docker for Mac (desktop) did not solve the trick, I had to actually select
Restart
from the menu and that fixed the issue.In fedora 27 I can work around this issue by disabling my firewall and restarting docker.
systemctl stop firewalld
systemctl restart docker
@mad-raz Thanks a lot for the solution. I spent hours figuring it out and your answer worked
+1 on mac. I tried delete all containers and restart Docker. But It happens again…
one of the causes of this issue, is miss configuring
docker-compose.yml
if the port is not used outside the containers it should beexpose:
d instead ofports:
ed as usingports
exposes the port both to the other service containers and to the host machine… whileexpose
only exposes the port to the other service containers (not interfering with the host port mappings)…I got it by doing the command sudo systemctl stop httpd or sudo /etc/init.d/apache2 stop
That’s a great workaround, but restarting indicates a bug and this issue shouldn’t be closed.
stop your docker daemon and start as an admin.
Same problem here @namerci. Need to manually reboot docker after windows are fully booted.
just do it;
sudo apachectl stop
Same issue on Windows 10. Solved by just restarting Docker (reboot of computer didn’t work).
Or, you can connect to the xhyve VM, by:
So I managed to fix my issue. Ideally I didn’t want to uninstall Docker as I want to keep all my images, I have quite a few downloaded! Instead, I deleted all my custom networks, removed all my containers and then deleted
docker/network/files/local-kv.db
and restarted my machine.It appears that something internally in Docker was broken in this file and persisted, and there was no way to clear it or fix it. This is probably because I started on version 1.11, then went through all the 1.12 release candidates and am now on 1.12, so maybe something along the upgrade path broke it.
Now it seems to be working fine 😄 I have the old local-kb.db file saved if anyone from the Docker team would like to take a look at it if it would be useful. To recap, the problem was the daemon listening on port 80 and 443 even if there were no containers listening on those ports.
the solution above works for me, thanks.
when docker is running, I got this below. when docker restarted, I still got this below. when docker service killed and restarted, port occupacy gone, docker works again.
Having same issues on Oracle Linux. Restarting Docker service helped.
I cannot start any container after windows and docker is fully booted. No waiting fixes that. Restarting Docker from Docker for Win status bar icon solves it.
100% of the time Docker doesn’t work after boot/reboot and I have to restart the docker daemon in 100% of the cases.
EDIT: yes, @IGZmanuelMartinVivaldi , this works, but I have to do it every restart of the host. Is this an issue with compose, or with Docker daemon in general?
The same issue on Windows 10. Error response from daemon: driver failed programming external connectivity on endpoint after attempting to restart a container.
Unfortunately none of all the suggestions worked for me. Docker for Mac Edge 18 something. High Sierra.
Only thing that did work was to wait until Docker started after system reboot and then run
$ docker-compose up -d --force-recreate
manually. Super sad.In the end I downgraded back to Docker for Mac Stable 17 something and everything works fine again.
@biscuit314 Your suggestion of restarting the docker service worked for me, bit of a problem if Windows isn’t restoring it well or Docker can’t handle how Windows does this.
I had this problem on Windows 10 Pro and I stopped IIS service, then works!
I ended up resetting Docker (and therefore deleting all containers), and that worked again, all ports being released 😕
I’m having the problem with running postgres. I verified that postgres is not running on my host machine with
brew services stop postgres
. I ranlsof -i :5432
and got the following output:Is docker running postgres for something internal? When I killed the process with SIGINT the docker status bar icon started rolling and it restarted the service. The only way I could get it to work was to change the host port in my docker-compose file.
A workaround by uninstalling docker from the top bar menu (Docker icon > Preferences > Uninstall) and reinstall it 😦
Had same kind of error
Error starting userland proxy: write /port/tcp:0.0.0.0:80:tcp:172.17.0.5:80/ctl: errno 526
It was nginx for me. I had to kill the nginx to get around it
sudo nginx -s stop
Yes, it is worked for me. I have OS X without activated apache, but few days a got i used this website: https://coolestguidesontheplanet.com/upgrade-php-on-osx/ for update PHP.
After this script
recommended for php updating apache was activated and i got surprise with my containers.
When we want “update php” we aren’t want “activate apache”, but website above have first position in the google 😦
Happy dockering!
How does one “release” the port that is in use so that compose can bring up the container again? First time it happened, I waited for a minute or so and it worked on second attempt. Second time, its been about an hour. Docker compose kill, down, rm --all, etc. and something still has a hold of it.
I had the same issue which was caused by my local php8 instance (local apache2 server took over the address)
sudo systemctl stop apache2.service
Solved it.same here. Reinstalled PHP on my Ubuntu 20.04 and had a simple test running. Seems like apache runs per default on port 80:
just read through this thread, and what seems to be the best answer in 2021 is to restart docker service (sv restart docker, systemctl restart docker, etc …) That indeed makes it work again, but why this is happening is unclear still from this thread
Hi @fede-r1c0, I don’t know why you mentioned me and probably you wanted to mark another user. Anyway, I’m happy you solve your problem. 👍
Stopping the docker service in task manager solved my problem on W10
for windows problem easily can solve: just restart your docker and try to run again the server.
sudo apachectl stop
this worked for me as it seemed that apache was running on MacClicking on the Docker Desktop icon on tray and select Restart… worked for me on Windows 10!
Restarting docker is worked for me only first time. After that whenever i hit
docker run
command it gives me same error. It is not fixed permanently.What i am trying to achieve:
I am just trying to setup LEMP (nginx, php-fpm, MySQL) environment on my centos 7 machine.
Commands:
Restarted docker
service docker restart
Create bridge network
docker network create -d bridge LEMP
Run php-fpm container
On first run command after, It works with following output:
b003815c0ee2fba05aa24b0965871b55ce717fcd56557066acd448519b59498b
iptables -L
If you notice, It has removed my DOCKER chain. Now when i am trying to run my nginx container, It gives me same error:
2dab94327ebbfb1849960df440cd8a1ba15b6253471b77838a5dce139b5cccdc
Workaround which works for me:
Docker version:
docker -v
Docker version 18.09.0, build 4d60db4
Old machine kernel version:
uname -r
3.10.0-957.1.3.el7.x86_64
Taken another machine with different kernel version:
uname -r
3.10.0-862.2.3.el7.x86_64
o/p
It worked. No error occurred like above. Everything is running smoothly.
I changed my kernel of old machine and it worked for me. Although this is not good to change your kernel especially on production.
Had the same issue today. I ran
docker-compose down
and restarted the docker service which seemed to do the trick.This does not solve the problem, I started the terminal and docker itself in Administrator mode and it still throws this exact same error.
It helped me.
Same here 😦 Restarting docker for windows or sometimes stopping containers then
docker system prune
worksI encountered the problem on an AWS Ubuntu 16 Server. Simply
sudo service docker restart
solved my problems…For anyone still coming here from Google: For my local dev machine it was just DHCP gave me a new lease and the docker service didn’t pick up on it and couldn’t create the network mappings anymore.
Had the same issue, seems like some containers was still running and blocking the ports.
do a “docker ps -a” to check if you have running containers run “docker kill $(docker ps -q)” to stop all running containers
I restarted docker and it worked
sudo service docker stop
thensudo service docker start
I’m getting a similar issue on OSX with a UDP port, removing
local-kv.db
doesn’t seem to be an option as the port remains stuck even when docker engine / VM is stopped but a reboot clears the bound port. Seems to be an issue on OSX side.$ netstat -na|grep "\.53"
<- no udp port 53 bound$ docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN --name dnsmasq -d andyshinn/dnsmasq:2.75
$ netstat -na|grep "\.53"
udp4 0 0 *.53 *.*
<- ok, it’s now bound$ docker stop dnsmasq && sleep 2 && docker rm dnsmasq
$ netstat -na|grep "\.53"
udp4 0 0 *.53 *.*
<- remains!$ sudo lsof -i -n -P|grep ":53"
<- no output!$ netstat -tulnvp udp|grep 53
udp4 0 0 *.53 *.* 196724 9216 1307 0
<- ok we have a pid$ sudo ps aux|grep 1307
<- no matching pid!Some old “zombie” process appears to be holding on to the port but I can’t figure out how to release it.
OSX 10.11.6
$ docker version Client: Version: 17.03.0-ce API version: 1.26 Go version: go1.7.5 Git commit: 60ccb22 Built: Thu Feb 23 10:40:59 2017 OS/Arch: darwin/amd64
Server: Version: 17.03.0-ce API version: 1.26 (minimum version 1.12) Go version: go1.7.5 Git commit: 3a232c8 Built: Tue Feb 28 07:52:04 2017 OS/Arch: linux/amd64 Experimental: true
I have the same problem
Restarting docker service dosen’t help, the same with reboot of host machine.
I got the same problem. Deleted all the containers, network and local-kv.db + restart… now it works again.
FYI, tracked in the beta @ https://forums.docker.com/t/port-mappings-are-not-released/10565/11
Unfortunately running into the same issue today, running a Postgres container. Port in use error but the port isn’t used, ran all the diagnostic commands I could find to verify this. Restarting the Mac didn’t change anything. No way to rollback to the previous version, however, killing docker and restarting it with the following command seems to have fixed the issue:
MacOS user here. This problem usually happens randomly to me. No processes on the troubled port. Not even a single container, no vbox virtual machine up, nothing.
Restarting didn’t fix anything. Updating and restarting the Docker service using the Docker Desktop app fixed the issue. Not sure if this will fix the issue in the future.
@dmtanner thank you very much for your comment.
After upgrading packages on my system and rebooting I was stuck with docker trying to connect to IPv6 despite being disabled on my system.
Downgrading helped, the command is (in case someone is desperate and in a hurry)
EDIT: I did not realize that the issue was opened in 2016…
In my case the problem is definitely with IPv6: up to and including version 19 the fact that it is disabled on my system was handled correctly, I upgraded today to 20.something and random issues with containers not starting because of that happened. Downgrading fixed everything (there were no changes in the configuration of the containers). I did not have messages about the “HOST being already used …”, just
I had the same problem today on my Ubuntu 20.04. This error just appeared. I think it was because of a recent update.
Additional information:
important note: HOST is already in use.
Checking with ps and netstat the corresponding ports are free but on my system I have ipv6 disabled. Looks like Docker is trying to use ipv6 for whatever reason from now on??
run;
happened to be kernel networking debugging at the same time - a previous container instance was the culprit
was what gave it away when iptables couldn’t DNAT on the
docker0
interfaceand sudo service {nameOfService} stop
As of today, using W10 still having this issue. Restarted docker, still have the issue. Closed docker and re opened, still have the issue.
None of the others solutions worked for me 😕
As illogical as it sounds, simply restarting the service worked.
(Did not need to clear any caches, old files or anything.)
I was having this issue on Ubuntu 18.04, same as for @Jason-2020, restarting the docker service freed the port for me as well in my system.
I have the same bug. So surprised this thread runs all the way till now.
For any one on windows, if you encouter this problem after waking up windows from sleep mode, restarting the computer solves the problem for me.
There was a previous similar issue about fast boosting on windows and I assume these two are related…
win + r > cmd(запуск от имени администратора) > netstat -aon | more дальше ищем локальный адрес с портом :8000, запоминаем PID, > ctrl + alt + del переходим во складку “Подробности” ищем процесс с ID как у PID > снимаем задачу(завершаем задачу) > restart your Docker > и заново запускаем (Run) свой docker-compose. Это должно решить проблему 2 вариант: просто откройте ваш docker-compose.yml и измените порт с 8000 на любой другой( ports: - ‘8000:80’) > Run you docker
Restarting docker every time for this issue is just a workaround. Indeed it solves the problem as it stops all the ports which might be occupied by containers. But the real problem is reported ports do not show up with netstat or with docker ps command, so it becomes a real headache to identify which container is using the port.
If anyone finds a way other than Docker Restart or disabling Fast Startup, please post here.
My issue was that I’d initialised a Docker Swarm on my machine for some experimentation. Everything went back to normal after running
docker swarm leave --force
docker: Error response from daemon: driver failed programming external connectivity on endpoint sad_sanderson
None of these worked for me. Stopping the services (as described here) finally did the trick:
net stop docker
net stop com.docker.service
taskkill /IM "dockerd.exe" /F
taskkill /IM "Docker for Windows.exe" /F
net start docker
net start com.docker.service
"c:\program files\docker\docker\Docker for Windows.exe"
Got same issue.
My workaround (because that seem to be the only kind of solution) was to simply disable “Start Docker Desktop when you log in”. But keep it at start-up program in task management.
If you can’t find it in your task management you could place a shortcut in:
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
So my guess is that the way Docker uses the ‘Start Docker Desktop when you log in’ is not the way Windows 10 wants it.
Docker version: 18.09.2, build 6247962
Windows version: Windows 10 Pro Insiders Preview 1903, build 18898.1000
For Mac users: try stoing the httpd, apache services.
I have the same issue, that is related to IIS, so I have stopped that.
For me, it was because other containers were running using that port. I just changed the port mapping in
docker-compose.yml
, e.g for thememcache
container service:From:
To (external port next at 11212):
Had the same problem, simply restart docker fix it for me
I still have the same problem. It happens if you have enabled Fast Startup (enablede by default) in Windows 10. You can disable it -> https://www.windowscentral.com/how-disable-windows-10-fast-startup and then you will not need to restart docker every day. But it’s just a work around…
I solved it by updating windows build from 1803 to 1809
Same issue here - in my case apache running on port 80 was the problem.
This worked for me Thnks! 😃
I have the same issue and it can be solved by restarting docker.
restarting docker service helped me to resolve this issue.
version 18.09.0
Yeah, restarting does work but it’s still really annoying, I have to do that every time I want to launch Docker…
Disabling Fast Boot on Windows 10 helps
I had same problem on Mac OS Sierra 10.12.6. Docker version 18.03.1-ce.
I solved it by applying @a14m suggestion: Soution:
lsof -nP +c 15 | grep LISTEN
Find the process that is listening to the blocked port and kill it: kill -9 <PROCESS_ID>. For me it was:
kill -9 35957
Then restart Docker and it’s all good
I could attach any service to any port. For some reason the error message was showing me an IP address I didn’t recognise. I restarted Docker (Windows) and it worked from thereon.
As pointed out earlier. This is not a compose issue, it is a Docker issue. Hence why this is closed. There is an issue open for this in the Docker repo.
Windows 10 have something like fast boot. Probably this is a issue. On another PC without fast boot it works well.
wt., 22 maj 2018, 20:25 użytkownik rangeoshun notifications@github.com napisał:
@IGZmanuelMartinVivaldi I have same problem as @NoICE. I have to restart docker all the time after windows is fully booted. It was in Fall Creators update and the current one.
PS. I’m using docker compose, any my docker compose file uses version 2.
@NoICE looks like its a problem that started with the Windows 10 Fall Creators update, but I don´t know it will be fixed in the current Spring update or in the new Dockers versions
@IGZmanuelMartinVivaldi thanks this works
I was modifying some iptables configs. And encountered this error. Restarting the docker daemon fixed it…
I am using Windows 10.0.16299.125, Docker for Windows 17.12.0-ce (15139) and Linux containers. I turned off Skype and the error driver failed programming external connectivity on endpoint is gone. Here is my docker-compose.yml:
I’ve been continuously having this issue. The strange thing is i get ERR_SOCKET_NOT_CONNECTED in the browser when trying to access the service. Then i stop the container and try to start it again is when I get the error you are reporting.
Resarting the Docker engine fixes the issue, but it comes back shortly after.
After some digging i realized that my containers can communicate with each other via the internal IP addresses Docker assigns, but cannot communicate with the outside world (even google and such).
This could happen after 10 minutes, or after 2 hours of use.
I’m on MacOS High Sierra and the latest Docker for Mac.
Same error - same remedy - restarted Docker on Mac then reran command and it worked.
This might be an obvious thing to try, but I had this error, but I restarted Docker itself, and then started the containers and the error went away.
I had this happen to me. The port mapping didn’t show up when I did
netstat -an
on an Elevated Powershell prompt, though I didn’t try the same from within the VM. I had to restart Docker for Windows to remediate. This recreates the underlying VM as well.Deleting the
/var/lib/docker/network/files/local-kv.db
file and restarting docker also fixed this issue for me on Ubuntu@marcelmfs you are absolutely correct! thank you so much for that.
@madjam002 Thanks for this fix! this has been bugging me for a couple of months on Docker for Mac, i’ve had to resort to resetting to factory settings but running this in conjunction with restarting the xhyve vm has released those ports again.
@madjam002 yes except the last line, that is i did not run docker run --rm -v /var/lib/docker/network/files:/network busybox rm /network/local-kv.db because you said you haven’t tested this and I don’t know what the implications of deleting all those files will be, so I didn’t delete them because I want to see if I can fix this without removing and reinstalling docker from scratch.