I have a docker swarm configuration with 3 nodes. There is a network that sits on only one of the nodes. On that particular node, docker network ls
shows the network, docker network rm [network-id]
says "Error response from daemon: network ... not found" while docker network inspect [network-id]
show the network and it looks pretty good (Scope: swarm, Driver: overlay). Exactly like one that i have created test-wise in parallel to compare it with.
Any idea anyone? How can I get rid of that network- zombie?
Asked
Active
Viewed 1.7k times
20
![](../../users/profiles/6788.webp)
JRoppert
- 311
- 1
- 2
- 6
-
Does "docker network prune" affect the zombie network? – Johan Feb 16 '19 at 14:17
-
2No it doesnt I do experience the same problem. Can reproduce but not on purpose. Happens after a while. docker network ls
shows `id` `name` `overlay` `swarm` but `docker network rm – Matthis Kohli Mar 11 '19 at 14:05or gives: "Error response from daemon: network `id` not found
2 Answers
23
How can I get rid of that network- zombie?
Please try the following.
docker network inspect <id> or <name>
Under Containers you see all the containers that are still connected to the network
docker network disconnect -f <networkID> <endpointName> or <endpointId> try both
Next remove all unused networks
docker network prune
Fixed the problem for me ;)
![](../../users/profiles/513844.webp)
Matthis Kohli
- 331
- 1
- 5
-
2The container listed in `docker network inspect` isn't in `docker container ls`. But if I do a disconnect with the endpoint name, this seemed to help. – Geoffrey Wiseman May 30 '19 at 03:31
-
2I had to give the --force flag because without it, docker complained that the listed containers didn't exist. – Ryan Fox Jun 12 '19 at 01:16
-
@RyanFox Geoffrey Wieseman I updated my answer. Thank you for the input. We just experienced that we require the
or <-f> flag as well sometimes for reasons ... :) – Matthis Kohli Jun 12 '19 at 15:03 -
1nothing worked for me, only a "/etc/init.d/docker restart" removed the zombie network – daigorocub Jul 29 '19 at 09:11
-
1It worked for me, but I had to use the endpointName instead of endpointID – Edouard Berthe Apr 05 '20 at 09:34
-
2Thanks for the help, but although there were actually some containers listed in the containers section after doing `docker network inspect`, the command `docker network disconnect` (even with the `-f` flag and both endpoint name or ID) resulted in an error (the endpoint does not exist). Only a `sudo service docker restart` worked for me. – Edouard Berthe Nov 07 '20 at 18:44
-
I experienced that recently as well but one must admit we have RHEL 7.5 and Docker is quite outdated so more like our fault. – Matthis Kohli Nov 09 '20 at 04:28
0
I ran into a similar issue for my dev environment (unrelated to swarm) while experimenting with connecting containers across docker compose instances. I tried stopping / starting compose, killing containers, removing images, pruning networks, and restarting docker numerous times and in a variety of sequences, yet nothing worked.
Finally I ran the following on the problematic instance while the other compose instances were up, which did work:
docker system prune
This removed (per the warning):
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
![](../../users/profiles/959031.webp)
user3006381
- 101