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

"driver failed programming external connectivity on endpoint" (1.7.0-rc1) #3277

Closed
jamshid opened this issue Apr 6, 2016 · 305 comments
Closed

Comments

@jamshid
Copy link

jamshid commented Apr 6, 2016

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"

verbose.txt

@aboch
Copy link

aboch commented Apr 6, 2016

@jamshid
Can you post the o/p of sudo netstat -nlp | grep 8123. Thanks.

@jamshid
Copy link
Author

jamshid commented Apr 6, 2016

My mac says -p requires an argument, so I think this is what you want:

$ sudo netstat -nl -p tcp  | grep 8123
(nothing)
$ sudo netstat -nl -p tcp  | head    # to confirm mac output is what you expect
Active Internet connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4       0      0  192.168.2.4.52918      216.58.194.34.80       ESTABLISHED
tcp4       0      0  192.168.2.4.52917      23.199.236.147.80      ESTABLISHED
tcp4       0      0  192.168.2.4.52916      192.229.163.25.443     ESTABLISHED
tcp4       0      0  192.168.2.4.52915      192.229.163.175.80     ESTABLISHED
...
$ docker ps -a | grep 8123
7baf5b2ec0eb        clue/polipo               "polipo proxyAddress="   26 minutes ago      Up 12 minutes                  8123/tcp            test_httpcache_1
3fea15e3d5b4        clue/polipo               "polipo proxyAddress="   33 minutes ago      Up 19 minutes                  8123/tcp            buildenv_httpcache_1

@bezelga
Copy link

bezelga commented Apr 29, 2016

same thing happening to me.

@leeahoward
Copy link

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

@elghazal-a
Copy link

elghazal-a commented May 4, 2016

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
`

@zh4ngx
Copy link

zh4ngx commented May 5, 2016

Following the above message, I get Error starting userland proxy: Failed to bind: EADDRINUSE.
Confused as to where the conflict is where none existed before

@mattgi
Copy link

mattgi commented May 7, 2016

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.

@mattgi
Copy link

mattgi commented May 7, 2016

FYI, tracked in the beta @ https://forums.docker.com/t/port-mappings-are-not-released/10565/11

@elghazal-a
Copy link

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 with 53: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?

@rsilveira65
Copy link

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

@madjam002
Copy link

I too am getting this after upgrading to Docker 1.12-rc2, not sure if this is the right place to post this.

Client:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   906eacd
 Built:        Fri Jun 17 20:35:33 2016
 OS/Arch:      darwin/amd64
 Experimental: true

Server:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   906eacd-unsupported
 Built:        Fri Jun 17 21:12:28 2016
 OS/Arch:      linux/amd64
 Experimental: true

@madjam002
Copy link

Full error:

Error response from daemon: driver failed programming external connectivity on endpoint xxx_xxx_1 (xxx): Bind for 0.0.0.0:2224 failed: port is already allocated

netstat:

tcp6       0      0 :::2224                 :::*                    LISTEN      9083/docker-proxy

@deg
Copy link

deg commented Jun 22, 2016

I'm seeing this sporadically. Retrying the command after a minute usually "fixes" the problem.
This is after moving to Docker for Mac yesterday.

$ docker version
Client:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   906eacd
 Built:        Fri Jun 17 20:35:33 2016
 OS/Arch:      darwin/amd64
 Experimental: true

Server:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   a7119de
 Built:        Fri Jun 17 22:09:20 2016
 OS/Arch:      linux/amd64
 Experimental: true

@kausik93
Copy link

I've also been getting the same error as you guys. I believed it was because nginx was binding it ports that were already taken up but I don't think so now. Did anyone find any solutions to this? :)

@briankelleher
Copy link

+1 Same error on mac

@joemewes
Copy link

joemewes commented Jul 6, 2016

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.

@krim
Copy link

krim commented Jul 7, 2016

+1 have the same problem on mac

@leifdejong
Copy link

leifdejong commented Jul 7, 2016

@TuningGuide MacBook Pro (15-inch, Late 2011), 2.2 GHz Intel Core i7, 8GB 1333 MHz DDR3
Running Node 4.4.7 extended to support Ember CLI. Setup is below:

FROM node:4.4.7

# expose ember-cli ports
EXPOSE 4200 35729 49152

# install ember-cli dependencies
RUN npm install -q -g ember-cli
RUN npm install -q -g bower
RUN npm install -q -g phantomjs-prebuilt

# install watchman
# http://ember-cli.com/user-guide/#watchman
RUN \
  git clone https://github.com/facebook/watchman.git &&\
  cd watchman &&\
  git checkout v3.5.0 &&\
  ./autogen.sh &&\
  ./configure &&\
  make &&\
  make install

Ran with mounted volume of the ember-cli files using 'ember serve' as the command.

@luki3k5
Copy link

luki3k5 commented Jul 8, 2016

+1 same problem on the mac with docker for mac

@TuningGuide
Copy link

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

@miraage
Copy link

miraage commented Jul 8, 2016

➜  ~ docker info
Containers: 2
 Running: 0
 Paused: 0
 Stopped: 2
Images: 2
Server Version: 1.12.0-rc3
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 21
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.14-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.954 GiB
Name: moby
ID: GZAT:26TX:PYCM:KKNA:JSWY:AMEL:RQYI:O23B:QGSQ:WBVB:3Q7E:XDPJ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 18
 Goroutines: 30
 System Time: 2016-07-08T17:41:26.03558348Z
 EventsListeners: 1
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
➜  ~ cat docker-compose-local.yml
version: '2'
services:
  cache:
    image: redis
    command: redis-server --appendonly yes
    ports:
      - "6379:6379"
  db:
    image: postgres:9.4
    ports:
      - "5432:5432"
    volumes:
      - ./tmp/dump.gz:/tmp/dump.gz
      - ./tmp/dump.sh:/docker-entrypoint-initdb.d/dump.sh
    environment:
      POSTGRES_DB: dbname
      POSTGRES_USER: dbuser
      POSTGRES_PASSWORD: dbpass

Got next errors:

ERROR: for cache  driver failed programming external connectivity on endpoint carsaver_cache_1 (253054ef6864bdcb5377bd1690173fa352021d505dc05c3aafecf66b02c0b73d): Error starting userland proxy: write /port/tcp:0.0.0.0:6379:tcp:172.18.0.2:6379/ctl: errno 526

ERROR: for db  driver failed programming external connectivity on endpoint carsaver_db_1 (8a5990bd06a50d87c7db96de84367bb01b71c971d5a4b9e578fea7d75d893d59): Error starting userland proxy: write /port/tcp:0.0.0.0:5432:tcp:172.18.0.3:5432/ctl: errno 526
ERROR: Encountered errors while bringing up the project.

@miraage
Copy link

miraage commented Jul 8, 2016

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.

@FrenchBen
Copy link

FrenchBen commented Jul 8, 2016

@miraage happy to hear you solved your issue.
I didn't have your volume data+dump.sh but did a quick compose without issues:

Creating driverfailed_cache_1
Creating driverfailed_db_1
Attaching to driverfailed_cache_1, driverfailed_db_1

@jamshid Why are you specifying an IP for socat (not familiar with it)? How are you using it?
Doing a docker-compose up without the IP I don't have any issues:

Creating socat_httpcache_1
Creating socat_socat_httpcache_1
Attaching to socat_httpcache_1, socat_socat_httpcache_1
docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
f2e3b3767982        bobrik/socat        "socat TCP-LISTEN:812"   2 seconds ago       Up 1 seconds        0.0.0.0:8123->8123/tcp   socat_socat_httpcache_1
43dbd35629e0        clue/polipo         "polipo proxyAddress="   3 seconds ago       Up 2 seconds        8123/tcp                 socat_httpcache_1

If your goal is for your http_cache to talk to the socat container, why not put them on the same network and be done with it?

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
    networks:
      - socatnet

  socat_httpcache:
    restart: always
    hostname: POLIPO1
    image: bobrik/socat
    mem_limit: 50m
    command: TCP-LISTEN:8123,fork,reuseaddr TCP:httpcache:8123
    depends_on:
      - httpcache
    networks:
      - socatnet
networks:
  socatnet:

@marcelmfs
Copy link

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 moby/moby#23371 (comment) - but I'm still not sure about that.

djs55 added a commit to djs55/vpnkit that referenced this issue Jul 11, 2016
…ases

Previously we lacked a function to convert from Uwt.error to Unix.error.
Happily uwt.0.0.3 contains such a useful error converting function, so
we use it.

When a port forward is requested, use `Lwt.catch` to handle the exception
at the top-level and pretty-print the error message for the expected cases

- EADDRINUSE: the port was already 'allocated'
- EADDRNOTAVAIL: the interface IP was not found (probably it exists in a
  VM but not on the host)
- EPERM: insufficient privileges to bind a privileged port

The pretty-printing is intended to match the output of `docker` on
regular Linux.

This is related to [docker/compose#3277]

Signed-off-by: David Scott <dave.scott@docker.com>
djs55 added a commit to djs55/vpnkit that referenced this issue Jul 12, 2016
…ases

Previously we lacked a function to convert from Uwt.error to Unix.error.
Happily uwt.0.0.3 contains such a useful error converting function, so
we use it.

When a port forward is requested, use `Lwt.catch` to handle the exception
at the top-level and pretty-print the error message for the expected cases

- EADDRINUSE: the port was already 'allocated'
- EADDRNOTAVAIL: the interface IP was not found (probably it exists in a
  VM but not on the host)
- EPERM: insufficient privileges to bind a privileged port

The pretty-printing is intended to match the output of `docker` on
regular Linux.

This is related to [docker/compose#3277]

Signed-off-by: David Scott <dave.scott@docker.com>
@igorrKurr
Copy link

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. 👍

@marcosalberto
Copy link

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.

@surajadh
Copy link

For me it was squid, I stopped squid and didn't see that anymore. So I think it may have to do with whatever is taking up the port and if we force docker to map that port.

@FanYikang
Copy link

FanYikang commented Oct 20, 2020

I've encountered same behavior.
This solved my issue on centos7:
ps -ef | grep docker
kill the "...dockerd -H fd:// --containerd=/run/containerd/containerd.sock" process

@JackOfSpade
Copy link

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.

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

@Slisarenko
Copy link

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

@vakenbolt
Copy link

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.

@nagy135
Copy link

nagy135 commented Jan 24, 2021

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

@krisnova
Copy link

krisnova commented Jan 30, 2021

run;

systemctl restart docker

happened to be kernel networking debugging at the same time - a previous container instance was the culprit

iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8081 -j DNAT --to-destination 172.17.0.2:2342 ! -i docker0: iptables: No chain/target/match by that name.

was what gave it away when iptables couldn't DNAT on the docker0 interface

@lucatsf
Copy link

lucatsf commented Feb 4, 2021

I got it by doing the command
sudo systemctl stop httpd or sudo /etc/init.d/apache2 stop

@mortensassi
Copy link

I got it by doing the command
sudo systemctl stop httpd or sudo /etc/init.d/apache2 stop

same here. Reinstalled PHP on my Ubuntu 20.04 and had a simple test running. Seems like apache runs per default on port 80:

# $ sudo netstat -nlp | grep 80
tcp6       0      0 :::80                   :::*                    LISTEN      848/apache2         

@Daniel-M
Copy link

Daniel-M commented Apr 9, 2021

I'm experiencing the same problem with:

Docker version 20.10.5, build 55c4c88
docker-compose version 1.29.0, build 07737305

I'm unable to restart my services since docker-compose says they are already running, which is true because docker-compose brings those containers up and fails telling they are already up. Restarting the service systemctl restart docker.service and systemctl restart docker.socket does nothing unless I restart --yes, restart-- the OS

@mortensassi
Copy link

@Daniel-M you could try and find the docker process ps aux | grep docker and kill -9 <THE PID> - did you make sure no other process is occupying that port?

@Daniel-M
Copy link

Daniel-M commented Apr 9, 2021

@Daniel-M you could try and find the docker process ps aux | grep docker and kill -9 <THE PID> - did you make sure no other process is occupying that port?

I made 100% sure nothing else was using those ports. The odd thing was the following sequence

  • docker ps -a shows no containers
  • docker-compose up fails starting a couple of containers since the ports are allegedly in use
  • docker ps -a now shows the failed containers running, the ones docker-compose reported as failed to start
  • Only those containers are running, so the project is useless

As for killing docker I did not tried that, I relied on systemctl, but will try that next time

After I restarted my computer today to continue working, docker-compose did not failed (as expected) but I'm not willing to try, have to keep working on things, I wouldn't be surprise it this happen gain, I will provide screnshots or even a video of the console

Thank you for your suggestion @mortensassi

@dmtanner
Copy link

I was having this same issue w/ docker. docker service restarts and OS restarts even would not fix it. I am on Ubuntu 20.04.

when running docker-compose up kept getting this error:
ERROR: for redis_1 Cannot start service redis: driver failed programming external connectivity on endpoint redis_1 (e55df4eefb70eh58dd408ac3a05385345a2eaa15a19aec555b629b91a77f0aeb): Error starting userland proxy: listen tcp6 [::]:5055: socket: address family not supported by protocol

and this warning:
WARNING: Host is already in use by another container

docker-compose version 1.29.0, build 07737305
I tried with docker version 20.10.6 and I also tried 19.03.15 and they both have the same problem.

The only way I was able to fix this was by rolling back docker to 19.03.9.

@davidcsi
Copy link

davidcsi commented Apr 15, 2021 via email

@renepardon
Copy link

renepardon commented Apr 16, 2021

I was having this same issue w/ docker. docker service restarts and OS restarts even would not fix it. I am on Ubuntu 20.04.

when running docker-compose up kept getting this error:
ERROR: for redis_1 Cannot start service redis: driver failed programming external connectivity on endpoint redis_1 (e55df4eefb70eh58dd408ac3a05385345a2eaa15a19aec555b629b91a77f0aeb): Error starting userland proxy: listen tcp6 [::]:5055: socket: address family not supported by protocol

and this warning:
WARNING: Host is already in use by another container

docker-compose version 1.29.0, build 07737305
I tried with docker version 20.10.6 and I also tried 19.03.15 and they both have the same problem.

The only way I was able to fix this was by rolling back docker to 19.03.9.

I had the same problem today on my Ubuntu 20.04. This error just appeared. I think it was because of a recent update.

$ docker -v
Docker version 20.10.6, build 370c289

$ docker-compose -v
docker-compose version 1.25.0, build unknown

Additional information:

WARNING: Host is already in use by another container

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??

Error starting userland proxy: listen tcp6 [::]:6379: socket: address family not supported by protocol

@wsw70
Copy link

wsw70 commented Apr 17, 2021

@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)

apt install docker-ce=5:19.03.15~3-0~ubuntu-bionic
systemctl stop docker
systemctl start docker

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

ERROR: for 0aa9cd2e88ae_mqtt Cannot start service mqtt: driver failed programming external connectivity on endpoint mqtt (7123295e1d2a17d53a88c9847db30deac6888dcd6a27f7901b0b8a3dedff2cb6): Error starting userland proxy: listen tcp6 [::]:8883: socket: address family not supported by protocol

@austinrivas
Copy link

austinrivas commented Apr 22, 2021

Ubuntu 20, Docker version 20.10.6, build 370c289

Updated docker and now getting this error, rolled back and resolved the issue.

Definitely and issue with the current docker release.

Cannot start service postgres: driver failed programming external connectivity on endpoint tradebinder_postgres_1 (8333460cee3dffb87b736b2af62c06ba0ffef7b28ca765ee686a9681d38ef66d): Error starting userland proxy: listen tcp6 [::]:5432: socket: address family not supported by protocol

@reneolivo
Copy link

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.

@liqin-z
Copy link

liqin-z commented May 14, 2021

Ubuntu 20.04 here, the error message was

Error response from daemon: driver failed programming external connectivity on endpoint nginx (b05d13ec7f7c76e6cb4e1bbec142a5655d875477c081e71371179cda80efadb0): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use
Error: failed to start containers: nginx

To resolve this issue, I used sudo netstat -plant | grep 80 and found that apache is using the port, and then I just typed sudo systemctl stop apache2.service.

Hope it helps.

@austinrivas
Copy link

austinrivas commented May 14, 2021

The same error is thrown when the port is occupied, but for users experiencing this issue who have confirmed the port is unoccupied it is more complicated.

The underlying issue is due to a breaking change introduced in Docker version 20.10.6 that breaks networking for devices that don't have ipv6 enabled.

The only solution is rolling back to 20.10.5 until a fix is published.

For additional info see here docker/for-linux#1233

Instructions on how to rollback and blacklist release 20.10.6 docker/for-linux#1233 (comment)

@CodingNagger
Copy link

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:

killall Docker && open /Applications/Docker.app

@snogrammer
Copy link

@CodingNagger same for me. I just updated to 3.4.0 and seems to be working for the time being, but keeping your command ready since force killing it seems to be the only way to get my containers to run.

@robin-blanchard
Copy link

Ran into this issue today. Tried many of the commands above, nothing worked.
Looking into netstat showed no process running on the same port. Launching the container on another port led to the same error.
Rebooting fixed the issue.

@kokizzu
Copy link

kokizzu commented Jun 18, 2021

ran this issue today
same port (9000) used by another program/docker
stopping all other docker on docker ps and the service (probably systemctl stop clickhouse-server) works

@PRodO5lNk5
Copy link

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.

@buckbeak99
Copy link

ERROR: for aa8d9522c8a3_fusion-chain-home-automation_client_1 Cannot start service client: driver failed programming external connectivity on endpoint fusion-chain-home-automation_client_1 (4156e28b67d576875589737c68273ab5cb3a1106cce29555cf2596e75386d2ef): Error starting userland proxy: listen tcp4 0.0.0.0:4200: bind: address already in use
I can't solve this error. Can anybody help me?
Thanks In Advance

@renepardon
Copy link

ERROR: for aa8d9522c8a3_fusion-chain-home-automation_client_1 Cannot start service client: driver failed programming external connectivity on endpoint fusion-chain-home-automation_client_1 (4156e28b67d576875589737c68273ab5cb3a1106cce29555cf2596e75386d2ef): Error starting userland proxy: listen tcp4 0.0.0.0:4200: bind: address already in use
I can't solve this error. Can anybody help me?
Thanks In Advance

As your error states: something is already running on port 4200.

@davidcsi
Copy link

davidcsi commented Apr 23, 2022 via email

@morales2k
Copy link

@buckbeak99 If you already restarted the docker service, and this is still popping up, then yes, something else (other than your docker containers) is taking that port number.

Sometimes docker ends up in a weird state where the containers are down but the networks are up and you cannot raise your containers because the ports are taken. Restarting the docker service should clear this issue.

@buckbeak99
Copy link

Thank you, @morales2k, and @davidcsi. After restarting my laptop, the error is solved completely. Thanks again for your precious advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests