Docker Swarm - network sandbox join failed: subnet sandbox join failed for "10.0.0.0/24": error creating vxlan interface: file exists
Asked Answered
W

4

18

I met this issue when deploying my application on Docker Swarm.

I run docker stack deploy -c /path and get error network sandbox join failed: subnet sandbox join failed for "10.0.0.0/24": error creating vxlan interface: file exists

I searched too many pages in Google but not found any solution.

Weir answered 1/9, 2020 at 7:46 Comment(0)
F
25

You can try to the following steps.

  1. Check each node for any vx-* interfaces in /sys/class/net
$ ls -l /sys/class/net/ | grep vx
  1. Once we have interface id's pull more details
$ udevadm info /sys/class/net/
  1. If these interfaces exist we should be able to safely remove them. Replace vx-000000-xxxxx with the interface id from Step 2
$ sudo ip -d link show vx-000000-xxxxx
$ sudo ip link delete vx-000000-xxxxx

etc...

  1. Redeploy the service.
Freed answered 21/11, 2020 at 21:31 Comment(2)
I had the same issue and these steps solved it, thank you very much!Dissociation
In my case i do not get usefull info in step 2. But you solved my problem. Thank you!Fuller
A
13

If you are on a raspberry pi with Ubuntu you may just be missing the necessary libraries. You can install them with:

sudo apt install linux-modules-extra-raspi
Armand answered 13/3, 2022 at 6:5 Comment(2)
worked for me (Ubuntu 22.04) ! tyInsuperable
That was it for me, too. (Ubuntu 22.04 LTS on a Pi4)Hughs
P
1

There might be conflict between multiple networks on your host

Did you check how many dockerd services is running? There might be two docker service is running on your host, via apt and snap

To remove docker via snap:

sudo snap remove docker

or, to avoid it creating back-up data:

sudo snap remove --purge docker

To remove docker via apt

sudo apt-get remove docker docker-engine docker.io containerd runc

And then reinstalled from here https://docs.docker.com/engine/install/ubuntu/

Pittsburgh answered 1/9, 2020 at 7:53 Comment(0)
S
0

I'm running docker swarm, and occasionally (by every few weeks) a service fails to start giving out this error.

The fix for me is to restart docker on the docker swarm node where the error is occuring. This seems to "free up" the network subnet, which causes the service/container to start successfully on another node automatically. So, in other words, please run

sudo systemctl restart docker  
Senile answered 27/9, 2023 at 12:21 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.