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
docker daemon occasionally returns error: failed to set IPv6 gateway while updating gateway: file exists #2455
Comments
I have also encountered the same issue (I think). When starting dockers concurrently w/ macvlan driver and IpV6, the api "SetGatewayIPv6" fails. We are starting about 20 dockers at the same time and almost always few of the dockers failed to start. After adding more debug, this is what i found, Here's what i got from RouteList() [ Thats the reason for RouteAdd to fail with EEXIST Further debugging revealed that, these routes are getting added as part IPv6 Router Advertisement (RA). Looks like newly created network namespace has this enabled "/proc/sys/net/ipv6/conf/eth2/accept_ra" Don't we have to set accept_ra=0 in macvlan driver??, otherwise SetGatewayIPv6() is going to randomly fail Docker VersionServer Version: 18.05.0-ce |
I can confirm this is an issue. Currently running a macvlan network for two containers and I'm randomly getting this error when starting them too fast (such as in docker-compose). Waiting for a bit (usually one or two minutes is enough) and then trying to restart the container seems to work just fine. Docker VersionServer Version: 19.03.5-ce |
* Update trove from branch 'master' to ae27a32a9f15e89f1f27f48fc255490c1b6dd97b - Fix docker daemon failed to set IPv6 gateway This commit sets "net.ipv6.conf.eth0.accept_ra" to 0 to avoid the file exists error. refer to: moby/libnetwork#2455 Change-Id: Ib0d7cec54bc79b3e29a95c298435b007e769e565
This commit sets "net.ipv6.conf.eth0.accept_ra" to 0 to avoid the file exists error. refer to: moby/libnetwork#2455 Change-Id: Ib0d7cec54bc79b3e29a95c298435b007e769e565
I have a python application that runs on a docker host (Ubuntu). The application basically allows users to concurrently start multiple containers on IPv4/IPv6 dualstack Macvlan network.
For example, if a user requests 3 containers, then the application tries to create and start 3 containers concurrently using 3 threads.
thread1: create -> start
thread2: create -> start
thread3: create -> start
Each container gets both IPv4 and IPv6 addresses assigned from the Macvlan network's IPv4/IPv6 pools.
Issue
The issue I encountered is the docker daemon occasionally returns below error when starting containers, and one of containers sometimes fails to start. It took about 250 times of attempts (each attempt = starting 2 containers concurrently and delete them) to see the error for 10 times.
The issue does not happen when IPv6 is not enabled, or when IPv6 is enabled but starting just one container at a time.
This makes me assume that there is an issue where IPv6 network is not properly handled for concurrent access.
System information
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
uname -a
Linux hostname 4.4.0-159-generic #187-Ubuntu SMP Thu Aug 1 16:28:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
docker version
Client: Docker Engine - Community
Version: 19.03.2
API version: 1.40
Go version: go1.12.8
Git commit: 6a30dfc
Built: Thu Aug 29 05:28:19 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.2
API version: 1.40 (minimum version 1.12)
Go version: go1.12.8
Git commit: 6a30dfc
Built: Thu Aug 29 05:26:54 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.6
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.0-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.0
GitCommit: fec3683
Note
I've seen this issue on Ubuntu 16.04, docker version 17.09.0-ce too.
The text was updated successfully, but these errors were encountered: