{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/etcd/issues/3296","labels_url":"https://api.github.com/repos/coreos/etcd/issues/3296/labels{/name}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/3296/comments","events_url":"https://api.github.com/repos/coreos/etcd/issues/3296/events","html_url":"https://github.com/coreos/etcd/issues/3296","id":100976258,"number":3296,"title":"Add member via API - no name parameter ? - fail to join","user":{"login":"tdeheurles","id":9496645,"avatar_url":"https://avatars.githubusercontent.com/u/9496645?v=3","gravatar_id":"","url":"https://api.github.com/users/tdeheurles","html_url":"https://github.com/tdeheurles","followers_url":"https://api.github.com/users/tdeheurles/followers","following_url":"https://api.github.com/users/tdeheurles/following{/other_user}","gists_url":"https://api.github.com/users/tdeheurles/gists{/gist_id}","starred_url":"https://api.github.com/users/tdeheurles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdeheurles/subscriptions","organizations_url":"https://api.github.com/users/tdeheurles/orgs","repos_url":"https://api.github.com/users/tdeheurles/repos","events_url":"https://api.github.com/users/tdeheurles/events{/privacy}","received_events_url":"https://api.github.com/users/tdeheurles/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-08-14T09:43:12Z","updated_at":"2015-08-14T20:37:07Z","closed_at":"2015-08-14T20:08:04Z","body":"I'm trying to join a one node \"cluster\" using the api add member.\r\n\r\n### attempt 1\r\nMy \"cluster\" is setup like that :\r\n```yaml\r\nname: bm0-coreos\r\nlisten-peer-urls: http://192.168.1.13:2380\r\nlisten-client-urls: http://192.168.1.13:2379, http://127.0.0.1:2379\r\ninitial-advertise-peer-urls: http://192.168.1.13:2380\r\ninitial-cluster: 'bm0-coreos=http://192.168.1.13:2380'\r\ninitial-cluster-state: 'new'\r\n```\r\n\r\nIf I follow the [API example](https://github.com/coreos/etcd/blob/master/Documentation/other_apis.md#add-a-member) :\r\n```bash\r\ncurl \\\r\n  http:192.168.1.13:2379/v2/members \\\r\n  -XPOST \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\"peerURLs\":[\"http:192.168.1.21:2380\"]}'\r\n{\"id\":\"ccbb503f075b1719\",\"name\":\"\",\"peerURLs\":[\"http://192.168.1.21:2380\"],\"clientURLs\":[]}\r\n```\r\n\r\nconfigure my joining coreos :\r\n```yaml\r\nname: tdeheurles-vm-coreos\r\ninitial-cluster: 'bm0-coreos=http://192.168.1.13:2380'\r\ninitial-cluster-state: 'existing'\r\n```\r\n\r\nBut when I try etcd :\r\n```\r\nError:  cannot sync with the cluster using endpoints http://127.0.0.1:4001, http://127.0.0.1:2379\r\n```\r\nLooking to the logs :\r\n```\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: setting maximum number of CPUs to 1, total number of available CPUs is 1\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: listening for peers on http://localhost:2380\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: listening for peers on http://localhost:7001\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: listening for client requests on http://localhost:2379\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: listening for client requests on http://localhost:4001\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: stopping listening for client requests on http://localhost:4001\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: stopping listening for client requests on http://localhost:2379\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: stopping listening for peers on http://localhost:7001\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: stopping listening for peers on http://localhost:2380\r\nAug 14 08:30:29 tdeheurles-vm-coreos etcd2[2081]: 2015/08/14 08:30:29 etcdmain: couldn't find local name \"tdeheurles-vm-coreos\" in the initial cluster configuration\r\nAug 14 08:30:29 tdeheurles-vm-coreos systemd[1]: etcd2.service: Main process exited, code=exited, status=1/FAILURE\r\nAug 14 08:30:29 tdeheurles-vm-coreos systemd[1]: etcd2.service: Unit entered failed state.\r\nAug 14 08:30:29 tdeheurles-vm-coreos systemd[1]: etcd2.service: Failed with result 'exit-code'.\r\n```\r\nThe relevant line seems to be : `etcdmain: couldn't find local name \"tdeheurles-vm-coreos\" in the initial cluster configuration`.\r\n\r\n### attempt 2\r\nI tried to remove name from the joining node cloud-config :\r\n```yaml\r\ninitial-cluster: 'bm0-coreos=http://192.168.1.13:2380'\r\ninitial-cluster-state: 'existing'\r\n```\r\nand the error logs became :\r\n```\r\n2015/08/14 08:44:18 etcdmain: couldn't find local name \"433fdd071c1d4d5095659d33624\r\n```\r\n\r\n### attempt 3\r\nJust made a try with joining coreos etcd-name as '433fdd071c1d4d5095659d33624' and it does not work too (not surprising but tested).\r\n\r\n### attempt 4\r\nI suppose the problem coming from the curl request. It does not give a name.\r\nSo I tried to give it a name (jq is just for pipelining json result in a pretty look) :\r\n```\r\n➜  ~  curl --silent -XPOST -H \"Content-Type: application/json\" \\\r\n           192.168.1.13:2379/v2/members \\\r\n            -d '{\"name\": \"tdeheurles-vm-coreos\", \"peerURLs\":[\"http://192.168.1.14:2380\"]}' \\\r\n           | jq '.'\r\n{\r\n  \"id\": \"4e5d9c1b1ae2a01f\",\r\n  \"name\": \"\",\r\n  \"peerURLs\": [\r\n    \"http://192.168.1.14:2380\"\r\n  ],\r\n  \"clientURLs\": []\r\n}\r\n➜  ~  etcdctl member list\r\n4e5d9c1b1ae2a01f[unstarted]: peerURLs=http://192.168.1.14:2380\r\nfae963b62c48c7f5: name=bm0-coreos peerURLs=http://192.168.1.13:2380 clientURLs=http://192.168.1.13:2379\r\n```\r\n\r\nIt does not take name in parameter.\r\n\r\nI must be missing something but what ... :-s"},"comment":{"url":"https://api.github.com/repos/coreos/etcd/issues/comments/131233560","html_url":"https://github.com/coreos/etcd/issues/3296#issuecomment-131233560","issue_url":"https://api.github.com/repos/coreos/etcd/issues/3296","id":131233560,"user":{"login":"xiang90","id":4479947,"avatar_url":"https://avatars.githubusercontent.com/u/4479947?v=3","gravatar_id":"","url":"https://api.github.com/users/xiang90","html_url":"https://github.com/xiang90","followers_url":"https://api.github.com/users/xiang90/followers","following_url":"https://api.github.com/users/xiang90/following{/other_user}","gists_url":"https://api.github.com/users/xiang90/gists{/gist_id}","starred_url":"https://api.github.com/users/xiang90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiang90/subscriptions","organizations_url":"https://api.github.com/users/xiang90/orgs","repos_url":"https://api.github.com/users/xiang90/repos","events_url":"https://api.github.com/users/xiang90/events{/privacy}","received_events_url":"https://api.github.com/users/xiang90/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T20:37:07Z","updated_at":"2015-08-14T20:37:07Z","body":">  I just needed to add\r\n\r\netcdctl can take a -peers list to find out your cluster. You do not have to listen on 127.0.0.1 to make the ctl work."}}