moby: Docker engine 1.9.0-rc1 does not gracefully restart

Description of problem: When stopping the docker daemon via service docker stop, it’s possible to get in a state where the engine immediately crashes on start with a network configuration issue. This is not resolved by restarting the docker host.

docker version:

Client:
 Version:      1.9.0-rc1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   9291a0e
 Built:        Wed Oct 14 03:04:22 UTC 2015
 OS/Arch:      linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

(Server version is same as client)

docker info: ?

uname -a: Linux vagrant-ubuntu-trusty-64 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Environment details (AWS, VirtualBox, physical, etc.): Ubuntu 14.04, VirtualBox (vagrant)

How reproducible: Not sure, happened on the 2nd time I restarted my daemon after upgrading from 1.8.2 to 1.9.0-rc1

Steps to Reproduce:

  1. Run a container
  2. Stop docker daemon
  3. Try starting docker daemon

Actual Results:

$ sudo service docker start
docker start/running, process 19174
$ sudo docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ sudo tail /var/log/upstart/docker.log
/var/run/docker.sock is up
INFO[0000] [graphdriver] using prior storage driver "aufs" 
INFO[0000] API listen on /var/run/docker.sock           
INFO[0000] Firewalld running: false                     
FATA[0000] Error starting daemon: Error initializing network controller: could not delete the default bridge network: network bridge has active endpoints 

Expected Results: Docker daemon does not crash immediately

Additional info:

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 58 (20 by maintainers)

Most upvoted comments

Removing the ‘/var/lib/docker/network’ folder worked for me.

I’d updated docker from 1.8 to 1.9 (Ubuntu 14.04) and had the same problem. Thanks to @guss77 i removed only /var/lib/docker/network and now everything works well and without containers lost.

Moving /var/lib/docker away solved the problem. I have the original storage if anyone wants to look at it.

@ruFog Removing /var/lib/docker/network also worked for me. Additional details:

  • Ubuntu 15.04 Vivid
  • Docker version 1.9.0, build 76d6bc9

@elicoidal thank you. I did in fact do a complete uninstall. Then I reinstalled version 1.10.2 and it still didn’t work. I also tried uninstalling and then installing version 1.9.2 and that didn’t work either.

It was because the default docker0 bridge wasn’t being created. i.e. when I ran sudo brctl show, no network interface was listed.

So I ended up creating my own bridge:

sudo service docker stop
sudo iptables -t nat -F POSTROUTING
sudo brctl addbr bridge0
sudo ip addr add 192.168.5.1/24 dev bridge0
sudo ip link set dev bridge0 up
sudo service docker start

echo 'DOCKER_OPTS="-b=bridge0"' >> /etc/default/docker

then when I did sudo brctl show, I saw my new bridge listed and was able to start / run containers using this bridge.

Just ran into this on fresh install of arch linux, with Docker version 1.10.2, build c3959b1 removing /var/lib/docker/network fixed this issue.

sudo rm -rf /var/lib/docker/network/files

solved!