{"action":"created","issue":{"url":"https://api.github.com/repos/moby/moby/issues/19261","repository_url":"https://api.github.com/repos/moby/moby","labels_url":"https://api.github.com/repos/moby/moby/issues/19261/labels{/name}","comments_url":"https://api.github.com/repos/moby/moby/issues/19261/comments","events_url":"https://api.github.com/repos/moby/moby/issues/19261/events","html_url":"https://github.com/moby/moby/issues/19261","id":126217315,"number":19261,"title":"v1.9.1 unable to remove network due to active endpoints","user":{"login":"Toady00","id":450576,"avatar_url":"https://avatars1.githubusercontent.com/u/450576?v=4","gravatar_id":"","url":"https://api.github.com/users/Toady00","html_url":"https://github.com/Toady00","followers_url":"https://api.github.com/users/Toady00/followers","following_url":"https://api.github.com/users/Toady00/following{/other_user}","gists_url":"https://api.github.com/users/Toady00/gists{/gist_id}","starred_url":"https://api.github.com/users/Toady00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toady00/subscriptions","organizations_url":"https://api.github.com/users/Toady00/orgs","repos_url":"https://api.github.com/users/Toady00/repos","events_url":"https://api.github.com/users/Toady00/events{/privacy}","received_events_url":"https://api.github.com/users/Toady00/received_events","type":"User","site_admin":false},"labels":[{"id":237472034,"url":"https://api.github.com/repos/moby/moby/labels/area/networking","name":"area/networking","color":"fbca04","default":false},{"id":190258329,"url":"https://api.github.com/repos/moby/moby/labels/kind/bug","name":"kind/bug","color":"FF8C94","default":false},{"id":375219499,"url":"https://api.github.com/repos/moby/moby/labels/version/1.9","name":"version/1.9","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":44,"created_at":"2016-01-12T16:28:29Z","updated_at":"2018-04-16T11:43:09Z","closed_at":null,"author_association":"NONE","body":"This is the same symptoms of #17555 but I am experiencing it with 1.9.1 and since #17558 was suppose to fix it, I'm assuming this should be a new issue.\n\nI have a Jenkins server running tests for a rails app. The build script sets up all the external dependencies in containers, runs the tests, and then removes all the containers. It was running on a t2.micro (single core) on AWS with no problems. I scaled it up to a t2.medium (2 cores) yesterday and the first time I ran the build, it failed when trying to remove the network, due to still having active endpoints.\n\nThe build script is basically cleaning up anything left over from older builds (in case of a failure), and then starts fresh. Here is the relevant portion of the build script:\n\n``` bash\ndocker stop ${db} || echo 'db already stopped'\ndocker rm ${db} || echo 'db already cleaned up'\ndocker network rm ${net} || echo 'network already cleaned up'\n\ndocker network create --driver bridge ${net}\ndocker run -d --net ${net} --name ${db} postgres\n```\n\nRemoving the network doesn't actually fail the build since the `||` is there, but it is erring with `active endpoints`. It actually fails when trying to create the network, since it already exists.\n\nI can see there are no containers connected to the network, but I can't remove the network. As a work around, I don't mind using a `sleep` between creating the network and running the container, but I'd love to know if there is a way to force remove the zombie network.\n\n``` bash\n$ sudo docker network inspect demo_net\n[\n    {\n        \"Name\": \"demo_net\",\n        \"Id\": \"ec089055c30c327935772574961f1b25dd2701c4d27ea1e34a70960595bd5f1f\",\n        \"Scope\": \"local\",\n        \"Driver\": \"bridge\",\n        \"IPAM\": {\n            \"Driver\": \"default\",\n            \"Config\": [\n                {}\n            ]\n        },\n        \"Containers\": {},\n        \"Options\": {}\n    }\n]\n$ sudo docker network rm demo_net\nError response from daemon: network demo_net has active endpoints\n```\n\nHere's all the basic docker stuff:\n\n``` bash\n$ sudo docker version\nClient:\n Version:      1.9.1\n API version:  1.21\n Go version:   go1.4.2\n Git commit:   a34a1d5\n Built:        Fri Nov 20 13:12:04 UTC 2015\n OS/Arch:      linux/amd64\n\n$ sudo docker info\nContainers: 8\nImages: 133\nServer Version: 1.9.1\nStorage Driver: aufs\n Root Dir: /var/lib/docker/aufs\n Backing Filesystem: extfs\n Dirs: 149\n Dirperm1 Supported: false\nExecution Driver: native-0.2\nLogging Driver: json-file\nKernel Version: 3.13.0-48-generic\nOperating System: Ubuntu 14.04.3 LTS\nCPUs: 2\nTotal Memory: 3.859 GiB\nName: jenkins\nID: UQJY:AGBB:HSJL:6XSW:4KBD:EVAB:W6A3:X7XN:RJRT:JDLO:MJBL:D3ZS\nWARNING: No swap limit support\n\n$ uname -a\nLinux jenkins 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux\n```\n\nt2.medium AWS instance running an official Ubuntu 14.04 AMI.\n"},"comment":{"url":"https://api.github.com/repos/moby/moby/issues/comments/381571087","html_url":"https://github.com/moby/moby/issues/19261#issuecomment-381571087","issue_url":"https://api.github.com/repos/moby/moby/issues/19261","id":381571087,"user":{"login":"surbhibakhtiyar","id":18613010,"avatar_url":"https://avatars0.githubusercontent.com/u/18613010?v=4","gravatar_id":"","url":"https://api.github.com/users/surbhibakhtiyar","html_url":"https://github.com/surbhibakhtiyar","followers_url":"https://api.github.com/users/surbhibakhtiyar/followers","following_url":"https://api.github.com/users/surbhibakhtiyar/following{/other_user}","gists_url":"https://api.github.com/users/surbhibakhtiyar/gists{/gist_id}","starred_url":"https://api.github.com/users/surbhibakhtiyar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surbhibakhtiyar/subscriptions","organizations_url":"https://api.github.com/users/surbhibakhtiyar/orgs","repos_url":"https://api.github.com/users/surbhibakhtiyar/repos","events_url":"https://api.github.com/users/surbhibakhtiyar/events{/privacy}","received_events_url":"https://api.github.com/users/surbhibakhtiyar/received_events","type":"User","site_admin":false},"created_at":"2018-04-16T11:43:09Z","updated_at":"2018-04-16T11:43:09Z","author_association":"NONE","body":"Faced the same issue. Unable to remove docker network. There are no running containers but still I am unable to remove the network. \r\n```\r\n# docker network rm 54f84fde7d37\r\nError response from daemon: network CFJzQhVL id 54f84fde7d3732777846993f388eda0527939ae65e7e1c45eea76de710bccfd6 has active endpoints\r\n```\r\n```\r\n# docker network inspect 54f84fde7d37\r\n[\r\n    {\r\n        \"Name\": \"CFJzQhVL\",\r\n        \"Id\": \"54f84fde7d3732777846993f388eda0527939ae65e7e1c45eea76de710bccfd6\",\r\n        \"Created\": \"2018-03-22T16:07:15.465038819Z\",\r\n        \"Scope\": \"global\",\r\n        \"Driver\": \"overlay\",\r\n        \"EnableIPv6\": false,\r\n        \"IPAM\": {\r\n            \"Driver\": \"default\",\r\n            \"Options\": {},\r\n            \"Config\": [\r\n                {\r\n                    \"Subnet\": \"172.16.173.128/26\"\r\n                }\r\n            ]\r\n        },\r\n        \"Internal\": false,\r\n        \"Attachable\": false,\r\n        \"Ingress\": false,\r\n        \"ConfigFrom\": {\r\n            \"Network\": \"\"\r\n        },\r\n        \"ConfigOnly\": false,\r\n        \"Containers\": {},\r\n        \"Options\": {},\r\n        \"Labels\": {}\r\n    }\r\n]\r\n\r\n```\r\n```\r\n$ sudo docker version\r\nClient:\r\n Version:      17.10.0-ce\r\n API version:  1.33\r\n Go version:   go1.8.3\r\n Git commit:   f4ffd25\r\n Built:        Tue Oct 17 19:04:05 2017\r\n OS/Arch:      linux/amd64\r\n```\r\n```\r\n# sudo docker info\r\nContainers: 0\r\n Running: 0\r\n Paused: 0\r\n Stopped: 0\r\nImages: 5\r\nServer Version: 17.10.0-ce\r\nStorage Driver: overlay2\r\n Backing Filesystem: extfs\r\n Supports d_type: true\r\n Native Overlay Diff: true\r\nLogging Driver: json-file\r\nCgroup Driver: systemd\r\nPlugins:\r\n Volume: local\r\n Network: bridge host macvlan null overlay\r\n Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog\r\nSwarm: inactive\r\nRuntimes: runc\r\nDefault Runtime: runc\r\nInit Binary: docker-init\r\ncontainerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0\r\nrunc version: 0351df1c5a66838d0c392b4ac4cf9450de844e2d\r\ninit version: 949e6fa\r\nSecurity Options:\r\n seccomp\r\n  WARNING: You're not using the default seccomp profile\r\n  Profile: /etc/docker/seccomp.json\r\nKernel Version: 3.10.0-693.17.1.el7.x86_64\r\nOperating System: CentOS Linux 7 (Core)\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 32\r\nTotal Memory: 125.7GiB\r\nName: xxxxxxx\r\nID: ASCQ:2GJR:XBMZ:GBLK:FJ3D:BZJ7:SSHS:VV5A:KEWN:JCZU:U5ZY:A6TX\r\nDocker Root Dir: /var/lib/docker\r\nDebug Mode (client): false\r\nDebug Mode (server): false\r\nRegistry: https://index.docker.io/v1/\r\nExperimental: false\r\nInsecure Registries:\r\n 127.0.0.0/8\r\nLive Restore Enabled: true\r\n```"}}
{"actor":{"display_login":"surbhibakhtiyar"}}