Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
area/networkingNetworkingkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.status/0-triageversion/26.1
Description
Description
Presumably since applying the last updates (I'm running Debian testing), I cannot create a custom bridge network and connect an existing container to it. The error message mentions that programming the IP address in the sandbox interface conflicts with an existing route of the form {Ifindex: 5 Dst: 0.0.0.0/0 Src: <nil> Gw: 172.17.0.1 Flags: [] Table: 254 Realm: 0}.
This is a setup that has worked for me for years, but doesn't work anymore.
Reproduce
- Run a container with the default bridge network:
docker run --rm -it --network=bridge --name=my-container debian:testing-slim - Create a second bridge network:
docker network create my-net - Try to connect the container to the custom bridge network:
docker network connect my-net my-container
Expected behavior
docker network connect should connect the container to my-net, in addition to the default bridge network.
Instead, it returns the following error:
$ sudo docker network connect my-net my-container
Error response from daemon: failed to add interface veth487637c to sandbox: error setting interface "veth487637c" IP to 172.18.0.2/16: cannot program address 172.18.0.2/16 in sandbox interface because it conflicts with existing route {Ifindex: 5 Dst: 0.0.0.0/0 Src: <nil> Gw: 172.17.0.1 Flags: [] Table: 254 Realm: 0}docker version
Client:
Version: 26.1.5+dfsg1
API version: 1.45
Go version: go1.23.4
Git commit: a72d7cd
Built: Sun Dec 29 18:36:47 2024
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 26.1.5+dfsg1
API version: 1.45 (minimum version 1.24)
Go version: go1.23.4
Git commit: 411e817
Built: Sun Dec 29 18:36:47 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.24~ds1
GitCommit: 1.7.24~ds1-4
runc:
Version: 1.1.15+ds1
GitCommit: 1.1.15+ds1-1+b1
docker-init:
Version: 0.19.0
GitCommit:docker info
Client:
Version: 26.1.5+dfsg1
Context: default
Debug Mode: false
Server:
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 407
Server Version: 26.1.5+dfsg1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 1.7.24~ds1-4
runc version: 1.1.15+ds1-1+b1
init version:
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.12.6-amd64
Operating System: Debian GNU/Linux trixie/sid
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 7.657GiB
Name: <redacted>
ID: <redacted>
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: falseAdditional Info
Network state after running the above commands:
$ ip route
default via 192.168.1.1 dev wlp61s0 proto dhcp src 192.168.1.21 metric 600
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.18.0.0/16 dev br-3b46a388c9c1 proto kernel scope link src 172.18.0.1 linkdown
192.168.1.0/24 dev wlp61s0 proto kernel scope link src 192.168.1.21 metric 600
$ sudo docker network ls
NETWORK ID NAME DRIVER SCOPE
bd87d73eabe7 bridge bridge local
a2d9388b4d06 host host local
3b46a388c9c1 my-net bridge local
142d1733427c none null local
$ sudo iptables -L -n -v
Chain INPUT (policy DROP 1261 packets, 129K bytes)
pkts bytes target prot opt in out source destination
27 2635 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
21 2075 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
15872 32M DOCKER-USER all -- * * 0.0.0.0/0 0.0.0.0/0
15872 32M DOCKER-ISOLATION-STAGE-1 all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- * br-3b46a388c9c1 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
0 0 DOCKER all -- * br-3b46a388c9c1 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- br-3b46a388c9c1 !br-3b46a388c9c1 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- br-3b46a388c9c1 br-3b46a388c9c1 0.0.0.0/0 0.0.0.0/0
9211 31M ACCEPT all -- * docker0 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
0 0 DOCKER all -- * docker0 0.0.0.0/0 0.0.0.0/0
6661 833K ACCEPT all -- docker0 !docker0 0.0.0.0/0 0.0.0.0/0
0 0 DROP all -- docker0 docker0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 120 packets, 11764 bytes)
pkts bytes target prot opt in out source destination
Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
pkts bytes target prot opt in out source destination
0 0 DOCKER-ISOLATION-STAGE-2 all -- br-3b46a388c9c1 !br-3b46a388c9c1 0.0.0.0/0 0.0.0.0/0
6661 833K DOCKER-ISOLATION-STAGE-2 all -- docker0 !docker0 0.0.0.0/0 0.0.0.0/0
15872 32M RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-ISOLATION-STAGE-2 (2 references)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * br-3b46a388c9c1 0.0.0.0/0 0.0.0.0/0
0 0 DROP all -- * docker0 0.0.0.0/0 0.0.0.0/0
6661 833K RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-USER (1 references)
pkts bytes target prot opt in out source destination
15872 32M RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
$ sudo iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 1478 packets, 159K bytes)
pkts bytes target prot opt in out source destination
22 1639 DOCKER all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 53 packets, 4224 bytes)
pkts bytes target prot opt in out source destination
0 0 DOCKER all -- * * 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT 53 packets, 4224 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * !br-3b46a388c9c1 172.18.0.0/16 0.0.0.0/0
197 28281 MASQUERADE all -- * !docker0 172.17.0.0/16 0.0.0.0/0
Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
0 0 RETURN all -- br-3b46a388c9c1 * 0.0.0.0/0 0.0.0.0/0
0 0 RETURN all -- docker0 * 0.0.0.0/0 0.0.0.0/0
Metadata
Metadata
Assignees
Labels
area/networkingNetworkingkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.status/0-triageversion/26.1
Activity
thaJeztah commentedon Jan 3, 2025
@gendx thanks for reporting. We haven't start building packages for Debian Trixie yet (other than some initial builds on pull request docker/containerd-packaging#395), as it's still a bit early (with it still being "Sid").
That said; already looking for possible issues with upcoming distros won't hurt; are you consistently able to reproduce this issue?
I see you're running a version of docker that's packaged by Debian, which is an older version of docker, and we have seen some issues in the past with distro-maintained packages of Docker. If this is a test-machine; could you try if installing the official docker packages for Debian show the same issue? As mentioned, we don't have packages for Trixie yet, but it's likely the packages for Bookworm would work; installation instructions can be found here, but you'd have to adjust the steps to
s/trixie/bookworm/https://docs.docker.com/engine/install/debian/also cc @robmry @akerouanton FYI
robmry commentedon Jan 3, 2025
It looks like #48368 (comment) ... but that'd mean the Debian-packaged version of 26.1.5 picked up a new version of
vishvananda/netlinkwithout fixing the issues - seems unlikely?thaJeztah commentedon Jan 3, 2025
Actually very likely. Distro packages have quite an opinionated way of packaging; they do NOT use the versions specified in our
vendor.mod(orgo.mod) but instead use a single version of any dependency for all binaries (i.e., there's only a single version ofnetlinkused for any Go package distributed by the distro.(and that has been the root cause of many broken packages, sometimes security issues as well)
thaJeztah commentedon Jan 3, 2025
There was a blog-post once, but can't find it immediately; here's some other links to that;
And; yes, it looks like netlink is at v1.3 in trixie; https://packages.debian.org/search?keywords=golang-github-vishvananda&searchon=names&suite=trixie§ion=all
They do have some patches applied, but looks like it's only for some failed tests;
https://sources.debian.org/patches/golang-github-vishvananda-netlink/1.3.0-2/
https://sources.debian.org/patches/golang-github-vishvananda-netlink/1.3.0-2/0001-Skip-failed-tests.patch/
robmry commentedon Jan 3, 2025
Oh dear! That's not going to work.
gendx commentedon Jan 3, 2025
So after some troubleshooting, it appears that it's a bug in the
26.1.5+dfsg1-4+b1version of thedocker.ioDebian package. Downgrading to26.1.5+dfsg1-2+b2fixed the issue (somehow I didn't manage to downgrade to the more recent26.1.5+dfsg1-4), which confirms the diagnostic that it's a problem in Debian's latest packaging.Reproduction steps
Downgrading a Debian package is a non-trivial experience, so I'm summarizing here what I did in case someone else encounters this issue.
Details
Looking in
/var/log/apt/history.log, I found the following entries indicating the recently applied Debian updates:Following the steps from this blog post, I managed to downgrade the
docker.iopackage version./etc/apt/sources.list.d/snapshots.listcontaining:sudo apt-get -o Acquire::Check-Valid-Until=false updatesudo apt-get remove docker.iosudo apt-get autoremove(optional I think)sudo apt-get install docker.io=26.1.5+dfsg1-2+b2/etc/apt/preferences.d/dockercontaining:After all that,
apt-cache policyconfirms that the downgraded version is pinned.robmry commentedon Jan 5, 2025
Thank you @gendx.
I've reported this to Debian folks as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1092165
So, I don't think there's anything else to track here - I'll close the issue.
For anyone else reading this - as noted above, these packages are worth a try ... https://docs.docker.com/engine/install/debian/