20

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?

2
  • Does "docker network prune" affect the zombie network?
    – Johan
    Feb 16, 2019 at 14:17
  • 2
    No it doesnt I do experience the same problem. Can reproduce but not on purpose. Happens after a while. docker network ls <network> shows id name overlay swarm but docker network rm <id> or <name> gives: "Error response from daemon: network id` not found Mar 11, 2019 at 14:05

2 Answers 2

24

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 ;)

7
  • 2
    The 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. May 30, 2019 at 3:31
  • 2
    I had to give the --force flag because without it, docker complained that the listed containers didn't exist.
    – Ryan Fox
    Jun 12, 2019 at 1:16
  • 1
    nothing worked for me, only a "/etc/init.d/docker restart" removed the zombie network
    – daigorocub
    Jul 29, 2019 at 9:11
  • 1
    It worked for me, but I had to use the endpointName instead of endpointID Apr 5, 2020 at 9:34
  • 2
    Thanks 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. Nov 7, 2020 at 18:44
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.