moby: Docker fails to create network bridge on start up
Description of problem: When freshly installing the docker 1.9.0 daemon, it sometimes fails to create the network bridge at startup and thus fails to start the daemon. It seems to fail about 50% of the time and I’m not sure why. Here’s some of the log output:
time="2015-11-20T05:32:35.395996380Z" level=info msg="API listen on /var/run/docker.sock"
time="2015-11-20T05:32:35.415570660Z" level=info msg="Firewalld running: false"
time="2015-11-20T05:32:35.441312772Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.1/16. Daemon option --bip can be used to set a preferred IP address"
time="2015-11-20T05:32:35.445369505Z" level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: failed to allocate gateway (172.17.0.1): No available addresses on this pool"
time="2015-11-20T05:32:35.562979814Z" level=info msg="API listen on /var/run/docker.sock"
time="2015-11-20T05:32:35.581794400Z" level=info msg="Firewalld running: false"
time="2015-11-20T05:32:35.672030288Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.1/16. Daemon option --bip can be used to set a preferred IP address"
time="2015-11-20T05:32:35.677536533Z" level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: failed to allocate gateway (172.17.0.1): No available addresses on this pool"
docker version
:
Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.2
Git commit: 76d6bc9
Built: Tue Nov 3 17:43:42 UTC 2015
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
docker info
:
Containers: 0
Images: 0
Server Version: 1.9.0
Storage Driver: overlay
Backing Filesystem: extfs
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.2.0-18-generic
Operating System: Ubuntu 14.04.3 LTS
CPUs: 1
Total Memory: 2.045 GiB
Name: vagrant
ID: 253M:O5XT:BJQK:AHRB:U5MI:OQZL:UUK4:YZAR:6XIH:XHV2:62QQ:3BET
WARNING: No swap limit support
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
uname -a
:
Linux default-ubuntu-1404 4.2.0-18-generic #22~14.04.1-Ubuntu SMP Fri Nov 6 22:20:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Environment details (AWS, VirtualBox, physical, etc.):
I’ve ran into this issue on both AWS and Virtualbox with the latest ubuntu 14.04 images with the linux-virtual-lts-wily
kernels installed (4.2.0)
How reproducible: It seems to be about a 50% chance that the install will fail due to not being able to create the network bridge interface at start up
Steps to Reproduce:
- Install the
linux-virtual-lts-wily
package onto an ubuntu 14.04 virtual box or AWS server - Install Docker 1.9.0, and enable the daemon with
-s overlay
- Sometimes it will fail, sometimes it will succeed
Actual Results: Docker does not run
Expected Results: Docker daemon should be running
Additional info:
I dont get this error if I use the linux-virtual-lts-vivid
kernel (3.19) instead.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 74 (20 by maintainers)
Commits related to this issue
- handle corrupted docker db state file ( causes net work issue https://github.com/docker/docker/issues/18113 — committed to EnginesOS/System by jvodan 9 years ago
- handle https://github.com/docker/docker/issues/18113 — committed to EnginesOS/EnginesInstaller by jvodan 9 years ago
- Possible work around for https://github.com/docker/docker/issues/18113 — committed to sgm-media/kubespray by jjungnickel 8 years ago
- Possible work around for https://github.com/docker/docker/issues/18113 — committed to sgm-media/kubespray by jjungnickel 8 years ago
@Chili-Man @dvanbuskirk @sheldonkwok When you experience the issue, can you please copy your
/var/lib/docker/network/files/local-kv.db
in some place where I can download it. I want to take a look at it.A possible work-around, please check, could be delete that file before starting the daemon.
Deleting
/var/lib/docker/network/files/local-kv.db
worked for meDocker on production system (ubuntu 14.04) not working anymore 😦
docker daemon INFO[0000] [graphdriver] using prior storage driver “aufs” INFO[0000] Graph migration to content-addressability took 0.01 seconds INFO[0000] Firewalld running: false FATA[0000] Error starting daemon: Error initializing network controller: Error creating default “bridge” network: failed to parse pool request for address space “LocalDefault” pool “” subpool “”: could not find an available predefined network
Tried to delete the files. Did not work. manual start throws the error above. Any ideas or workarounds out there? Can i downgrade to a specific version and how?
Docker version 1.10.3, build 20f81dd
edit: By the way a very disturbing bug for a stable release 😉
Last upgrade in apt.log:
Start-Date: 2016-04-06 06:49:08 Install: linux-image-extra-3.13.0-85-generic:amd64 (3.13.0-85.129, automatic), linux-image-3.13.0-85-generic:amd64 (3.13.0-85.129, automatic), linux-headers-3.13.0-85-generic:amd64 (3.13.0-85.129, automatic), linux-headers-3.13.0-85:amd64 (3.13.0-85.129, automatic) Upgrade: linux-headers-generic:amd64 (3.13.0.83.89, 3.13.0.85.91), linux-image-generic:amd64 (3.13.0.83.89, 3.13.0.85.91), linux-generic:amd64 (3.13.0.83.89, 3.13.0.85.91) End-Date: 2016-04-06 06:50:09
-> Was getting active with a restart today (i think)
edit again: Tried with 3.13.0-83-generic and it still fails.
Tried to reinstall docker with apt-get remove --purge docker-engine Then reinstalled docker-engine after a reboot.
EDit: Tried to remove /var/lib/docker -> still fails Edit: Tried to modprobe -r bridge -> still fails
WORKAROUND: Added in /etc/default/docker: DOCKER_OPTS=“–bip=172.17.42.1/16”
@Chili-Man this seems like a dupe of https://github.com/docker/docker/issues/17939. Can you pls make sure if there are multiple docker daemons running (either natively in the host or via dind using the same root directory as indicated in https://github.com/docker/docker/issues/17939).
sudo rm -rf /var/lib/docker
– destroy all Docker internal files (sometimes Docker gets into an invalid state and, unfortunately, this is the only way to correct it)sudo systemctl restart docker
- restart the Docker system service (turn it off and turn it back onwill fix it
This fixed it for me:
head -n -1 /etc/resolv.conf | sudo tee /etc/resolv.conf
(https://sdujancourt.me/2017/02/07/dockerd-error-initializing-network-controller-list-bridge-addresses-failed-no-available-network/)
@aboch, I just hit this issue when upgrading our 1.9.0 machines to 1.9.1 on Ubuntu 14.04.
“Fix” was to delete the:
If you guys need another local-kv.db file to look at, I can send it to you.
As there are several tickets written by people claming that IPv6 is broken, here is the solution how to configure it corretly. Someone should change the documentation accordingly.
Docker IPv6 is working perfectly, it’s just the documentation that doesn’t tell people what to do in order to set it up correctly.
Docker will not do SLAAC (Stateless Address Autoconfiguration), nor will it use DHCPv6. As it also won’t do NATv6 (thank god!), you will have to assign ipv6 prefixes to your networks manually. The default bridge network has to be assigned a network, you can do this by adding the following to daemon.json:
For any other network you might have, you can decide wether or not it will be ipv6 capable. To create an IPv6 capable network, do the following:
docker network create --ipv6 --subnet "2001:db8:1::/64" testnet
Also remember, that this is not NATv6 (thank god!). Therefor you will have to have a route from your router to your docker host!
I was experiencing the same problem. Removing
/var/lib/docker/network/files/local-kv.db
didn’t help. Turns out that I had already created a network with that IP range, sodocker network rm <my-network>
solved it for me.I am too running into this problem on docker 1.11.1 with docker-compose 1.7.1.
Deleting /var/lib/docker/network/files/local-kv.db leaves my docker instance in an unusable state, because already created containers now give errors and newly created containers don’t have a proper networks setting.
So long and thanks for all the fish… -.-
Remove all ipv6 nameservers from /etc/resolv.conf!
clockzhong notifications@github.com ezt írta (időpont: 2017. márc. 3., P 5:43):
I was experiencing this issue, but @DominicBoettger’s tip to set
--bip
did the trick for me. I noticed the problem with a VPN connection before docker started, so docker/libnetwork#779 is my real problem.I had this issue on Centos 7 host. I figured out that firewalld and docker don’t play well nicely together. If docker is started after firewalld, we get this error. Solution was to restart docker after firewalld. and then run docker here is a sample output case 1: Docker already running, then firewalld staretd
case 2. docker running, firewalld started , docker restarted