19

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 '19 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 '19 at 14:05
22

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 '19 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 '19 at 1:16
  • 1
    nothing worked for me, only a "/etc/init.d/docker restart" removed the zombie network
    – daigorocub
    Jul 29 '19 at 9:11
  • 1
    It worked for me, but I had to use the endpointName instead of endpointID Apr 5 '20 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 '20 at 18:44

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.