moby: Bind address already in use (introduced in 1.3)

After upgrading to 1.3 lots of create attempts throw an Error 500 indicating that address already in use.

Is there anything that I could do on my behalf to eliminate such errors or is there any issue with releasing bound addresses?

Error message example

Cannot start container e72d935d52d7bfc7412e8d60bf1c5705b54e33056c15cca5b902cca960f7b71a: Error starting userland proxy: listen tcp 0.0.0.0:49532: bind: address already in use

uname -a

Linux paris 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

docker version

Client version: 1.3.0
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): c78088f
OS/Arch (client): linux/amd64
Server version: 1.3.0
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): c78088f

docker -D info

Containers: 16
Images: 128
Storage Driver: devicemapper
 Pool Name: docker-202:1-525407-pool
 Pool Blocksize: 65.54 kB
 Data file: /dev/direct-lvm/data
 Metadata file: /dev/direct-lvm/metadata
 Data Space Used: 3.111 GB
 Data Space Total: 81.6 GB
 Metadata Space Used: 18.33 MB
 Metadata Space Total: 4.291 GB
 Library Version: 1.02.82-git (2013-10-04)
Execution Driver: native-0.2
Kernel Version: 3.13.0-36-generic
Operating System: Ubuntu 14.04.1 LTS
Debug mode (server): false
Debug mode (client): true
Fds: 43
Goroutines: 72
EventsListeners: 0
Init Path: /usr/bin/docker

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 1
  • Comments: 72 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I got the same problem using Docker for mac 1.11.0-beta9 (965e3f981d73fe82857f3c1439ba3dc1acaecab6) with docker-compose 1.7. As @edanShavit said, few seconds later the port was available and the nginx container could start again.

I’m also seeing this with 1.11.2

same problem here

docker start 4a3e1b96fd0d Error response from daemon: driver failed programming external connectivity on endpoint rancher (b5663e613796144e4e8ff93a3eb42c9214134c5d12cef8ee51918e59770968c6): Error starting userland proxy: listen tcp 192.168.2.22:8086: bind: address already in use Error: failed to start containers: 4a3e1b96fd0d

Docker version 1.11.2, build b9f10c9 Linux df01 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

netstat -lnp | grep 8086

and

ps aux | grep docker | grep 8086

return nothing

I’m seeing this on 1.8.1 on Ubuntu 14.04.3 LTS

Got hit by this today. On a recent version of docker 1.10.3. Only on few certain containers. The same ones each time.

Things have tried, to no avail:

  • Removed *.sock in /var/lib/docker/network/files
  • Restarted docker daemon
  • Deleting affected containers and re-creating them
  • Rebooted the computer
  • Rebooted LAN router, and ethernet bridges on this segment
  • Starting each containers more slowly, with a 1 sec gap in-between

Perhaps the last measure is more preventative. And will prove effective against repeat occurence. But current containers still broken for those ip(s).

Unfortunately for these particular container(s), changing their IP address isn’t so strightforward due to their hard-coded IP being used in other devices config… So a way to clean state would also be appreciated.