-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cant start docker 1.10 with ipv6 disabled via ipv6.disable=1 and an existing bridge with an IP #892
Comments
This bug happens on Docker 1.10.1 too. |
ping @aboch |
I tried to debug this and found that diff --git a/vendor/src/github.com/docker/libnetwork/drivers/bridge/interface.go b/vendor/src/github.com/docker/libnetwork/drivers/bridge/interface.go
index cdf6883..a913cbc 100644
--- a/vendor/src/github.com/docker/libnetwork/drivers/bridge/interface.go
+++ b/vendor/src/github.com/docker/libnetwork/drivers/bridge/interface.go
@@ -4,6 +4,7 @@ import (
"fmt"
"net"
+ "github.com/docker/libnetwork/types"
"github.com/vishvananda/netlink"
)
@@ -52,14 +53,23 @@ func (i *bridgeInterface) addresses() (netlink.Addr, []netlink.Addr, error) {
return netlink.Addr{}, nil, err
}
- v6addr, err := netlink.AddrList(i.Link, netlink.FAMILY_V6)
+ v6addrUnFiltered, err := netlink.AddrList(i.Link, netlink.FAMILY_V6)
if err != nil {
return netlink.Addr{}, nil, err
}
if len(v4addr) == 0 {
- return netlink.Addr{}, v6addr, nil
+ return netlink.Addr{}, v6addrUnFiltered, nil
}
+
+ // Ensure netlink.AddrList doesn't leak IPv4
+ var v6addr []netlink.Addr
+ for _, ipv6 := range v6addrUnFiltered {
+ if !types.CompareIPNet(ipv6.IPNet, v4addr[0].IPNet) {
+ v6addr = append(v6addr, ipv6)
+ }
+ }
+
return v4addr[0], v6addr, nil
}
Will put a pull request if this looks ok |
Apparently a fix has been proposed here |
@ppickfor @fudanchii Can you share your kernel version?
My environment
|
Ubuntu 14.04.3 and arch Linux with the latest kernel. IPv6 disabled completely at boot, not via sysctl. Try passing edit:
With IPv6 enabled:
|
I can reproduce now following "start docker twice without specifying a bridge". I tried to patch vishvananda/netlink#91 to docker and it really solves the issue. After vishvananda/netlink#91 getting merged, maybe @fudanchii you can push a PR to libnetwork ? |
Sure, will do 👍 |
applied
force AddList to get rid of unexpected information
from vishvananda/netlink#91
to docker master
commit b16536a
( I suspect there's a better way )
I can start up with ipv6.disable=1 and docker does not wipe the bridge
ip address
looks OK to me
looking forward to a binary I can try with this
Thanks
Peter
|
Sorry for seeing this issue so late. And the PR vishvananda/netlink#91 is for this issue. Thanks @fudanchii ! |
Thanks @fudanchii. Now that vishvananda/netlink#91 is merged, can you please push a PR to libnetwork to import the latest netlink. Thanks. |
- Fixes moby#892 Signed-off-by: Nurahmadie <[email protected]>
Was this introduced in 1.10.0? |
@dkiser Yes |
@aboch any workarounds for us that can't upgrade to 1.11.0 yet? |
@dkiser Sorry, not many options other than
|
The other option is the net.ipv6.conf.all.disable_ipv6=1 sysctl. Consider upgrading to 1.11 because it seems mostly a bugfix release based on the changelog. |
We had a similar issue on a centos like system Docker version 1.10.3 I added a systemd override file to manually clean up the "orphaned" docker0 interface whenever the service is stopped or fails to start. Add an override file (or configure the ExecStopPost command elsewhere)
Then update systemd with:
|
If OS is booted with ipv6.disable=1, to disable ipv6, and docker is started on an existing bridge with an IP address then docker fails to start with the following error:
"Error starting daemon: Error initializing network controller: Error creating default "bridge" network: Failed to setup IP tables, cannot acquire Interface address: Interface docker0 has no IPv4 addresses"
Removing ipv6.disable=1 is a work around but I would prefer to run without ipv6 enabled.
I veified that there was an IP address before attempting to start docker. After attempting to start docker there is no IP address on the bridge. Docker can start if is creates the bridge but not a second time as the bridge already exists.
to duplicate:
boot os with ipv6.disable=1
create a bridge
assign and ip address to the bridge
attempt to start docker with -b bridgename
(or start docker twice without specifying a bridge when booted with ipv6.disable=1)
The text was updated successfully, but these errors were encountered: