{"action":"created","issue":{"url":"https://api.github.com/repos/docker/libkv/issues/26","labels_url":"https://api.github.com/repos/docker/libkv/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/docker/libkv/issues/26/comments","events_url":"https://api.github.com/repos/docker/libkv/issues/26/events","html_url":"https://github.com/docker/libkv/issues/26","id":95690050,"number":26,"title":"Etcd ignores error code and exits prematurely on Watch","user":{"login":"abronan","id":1655859,"avatar_url":"https://avatars.githubusercontent.com/u/1655859?v=3","gravatar_id":"","url":"https://api.github.com/users/abronan","html_url":"https://github.com/abronan","followers_url":"https://api.github.com/users/abronan/followers","following_url":"https://api.github.com/users/abronan/following{/other_user}","gists_url":"https://api.github.com/users/abronan/gists{/gist_id}","starred_url":"https://api.github.com/users/abronan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abronan/subscriptions","organizations_url":"https://api.github.com/users/abronan/orgs","repos_url":"https://api.github.com/users/abronan/repos","events_url":"https://api.github.com/users/abronan/events{/privacy}","received_events_url":"https://api.github.com/users/abronan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/libkv/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-17T16:15:01Z","updated_at":"2015-08-03T09:52:54Z","closed_at":null,"body":"(From @springi99)\r\n\r\nHi,\r\n\r\nI am newbie here, i don't know whether is this the right forum for my problem...\r\nI have problem with using etcd as kv store:\r\n\r\ndocker -D -d --kv-store=etcd:10.0.0.105:4001 --label=com.docker.network.driver.overlay.bind_interface=eth1\r\n\r\nfailed because it cannot find keys in etcd. I tried to find a solution for this:\r\n\r\nin vendor/src/github.com/docker/libkv/store/etcd/etcd.go in Get() you should add error code 100 as well:\r\n````\r\n-                       if etcdError.ErrorCode == 102 || etcdError.ErrorCode == 104 {\r\n+                       if etcdError.ErrorCode == 102 || etcdError.ErrorCode == 104 || etcdError.ErrorCode == 100 {\r\n````\r\nfurthermore in WatchTree you should not return back when List() returns with error:\r\n````\r\n        current, err := s.List(directory)\r\n        if err != nil {\r\n -               return nil, err\r\n +               log.Info(\"watchtree error: \", directory)\r\n        }\r\n````\r\nwith these modification i can start docker with etcd. I am able to create overlay network, publish and attach service to a running container. The problem comes when i try to unpublish the service. in etcd the endpoint top directory is not deleted:\r\n\r\n                            {\r\n                                \"createdIndex\": 130,\r\n                                \"dir\": true,\r\n                                \"key\": \"/docker/libnetwork/endpoint\",\r\n                                \"modifiedIndex\": 130,\r\n                                \"nodes\": [\r\n                                    {\r\n                                        \"createdIndex\": 130,\r\n                                        \"dir\": true,\r\n                                        \"key\": \"/docker/libnetwork/endpoint/be2f0baf7de54e0499ee061c862bb3c405defa2d39e6fd8abfa8cbebbcbe451d\",\r\n                                        \"modifiedIndex\": 130\r\n                                    },\r\n                                    {\r\n                                        \"createdIndex\": 144,\r\n                                        \"dir\": true,\r\n                                        \"key\": \"/docker/libnetwork/endpoint/7e784942ec0c4430425bd6a68423c42d61db7eff249bced95f2a519cfa000dd0\",\r\n                                        \"modifiedIndex\": 144\r\n                                    }\r\n                                ]\r\n                            },\r\n\r\nand it seems veth pairs are not deleted, too.\r\n\r\nActually i did not try whether traffic goes through or not. Did you meet with this problem? Thanks your help in advance,\r\n\r\nrobert."},"comment":{"url":"https://api.github.com/repos/docker/libkv/issues/comments/127180958","html_url":"https://github.com/docker/libkv/issues/26#issuecomment-127180958","issue_url":"https://api.github.com/repos/docker/libkv/issues/26","id":127180958,"user":{"login":"springi99","id":9262768,"avatar_url":"https://avatars.githubusercontent.com/u/9262768?v=3","gravatar_id":"","url":"https://api.github.com/users/springi99","html_url":"https://github.com/springi99","followers_url":"https://api.github.com/users/springi99/followers","following_url":"https://api.github.com/users/springi99/following{/other_user}","gists_url":"https://api.github.com/users/springi99/gists{/gist_id}","starred_url":"https://api.github.com/users/springi99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/springi99/subscriptions","organizations_url":"https://api.github.com/users/springi99/orgs","repos_url":"https://api.github.com/users/springi99/repos","events_url":"https://api.github.com/users/springi99/events{/privacy}","received_events_url":"https://api.github.com/users/springi99/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T09:52:54Z","updated_at":"2015-08-03T09:52:54Z","body":"Hi,\r\n\r\nI created it, please check it. Thanks in advance!"}}