moby: Ubuntu 21.04: to bridge docker0 failed: could not find bridge docker0: route ip+net: no such network interface.

After a docker service starts, I can execute only one container. Restarting the container or starting a new one throws the following error:

$ sudo docker run --rm -ti ubuntu bash
docker: Error response from daemon: failed to create endpoint modest_turing on network bridge: adding interface veth620572c to bridge docker0 failed: could not find bridge docker0: route ip+net: no such network interface.

If I restart the service with sudo service docker restart and execute sudo docker run --rm -ti ubuntu bash again, it works.

Here are the docker daemon logs when the fail happens:

un 23 08:29:21 gandalf dockerd[3233]: time="2021-06-23T08:29:21.205486316-04:00" level=warning msg="Failed to delete host side interface (veth171e122)'s link" error="no such device"
Jun 23 08:29:21 gandalf dockerd[3233]: time="2021-06-23T08:29:21.215681107-04:00" level=error msg="82f07d51679aa97552e3c9950fae2ceb9210c12ca68a1597c3c797df79b7c50d cleanup: failed to delete container from containerd: no such container"
Jun 23 08:29:21 gandalf dockerd[3233]: time="2021-06-23T08:29:21.220122199-04:00" level=error msg="Handler for POST /v1.41/containers/82f07d51679aa97552e3c9950fae2ceb9210c12ca68a1597c3c797df79b7c50d/start returned error: failed to create endpoint quizzical_keldysh on network bridge: adding interface veth171e122 to bridge docker0 failed: could not find bridge docker0: route ip+net: no such network interface"

This bug started to happen when I upgraded from Ubuntu server 20.10 to 21.04. Note that I do have a TLS docker configuration setup but I have disabled everything to narrow down the bug (for example I don’t use an /etc/docker/daemon.json file neither override the systemd service file).

Here are the versions and infos:

$ sudo docker version
Client: Docker Engine - Community
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        f0df350
 Built:             Wed Jun  2 12:00:45 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:58:56 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.6
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
$ sudo docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 2
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.11.0-22-generic
 Operating System: Ubuntu 21.04
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.55GiB
 Name: gandalf
 ID: 4EZV:Z6PX:LAOA:H3GD:VCPP:LYF3:ZGMN:HGK4:JG4E:TLYN:LZOG:KJCR
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp38s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 70:85:c2:fb:2c:73 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.192/24 brd 192.168.0.255 scope global enp38s0
       valid_lft forever preferred_lft forever
    inet6 fe80::7285:c2ff:fefb:2c73/64 scope link 
       valid_lft forever preferred_lft forever
3: wlp37s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 50:e0:85:f4:eb:47 brd ff:ff:ff:ff:ff:ff

Note that I am using the official Docker channel for the packages but I have also tried the one shipped by default in Ubuntu (currently 20.10.2) and see the same bug.

I have also looked into the closed and open issues of the repo without success.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

Not sure if it will help, had a similar issue and found that it was related to the following package ‘netscript-2.4’ I installed it to make dealing with network from CLI easier, then the issues started. removed and they went away.

Couldn’t get to the bottom of why but.

Anyway, Removing the package and issue went away.
“sudo apt remove netscript-2.4”

good luck.

Not sure if it will help, had a similar issue and found that it was related to the following package ‘netscript-2.4’ I installed it to make dealing with network from CLI easier, then the issues started. removed and they went away. Couldn’t get to the bottom of why but. Anyway, Removing the package and issue went away. “sudo apt remove netscript-2.4” good luck.

Solved the problem for me, you saved my day

Solved for me too, thanks

Last interesting note: when I first start the docker daemon I can indeed see the docker0 interface in ifconfig. But after shutting down the first successful running container the docker0 interface disappear.