{"action":"created","issue":{"url":"https://api.github.com/repos/myodc/go-micro/issues/16","labels_url":"https://api.github.com/repos/myodc/go-micro/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/myodc/go-micro/issues/16/comments","events_url":"https://api.github.com/repos/myodc/go-micro/issues/16/events","html_url":"https://github.com/myodc/go-micro/issues/16","id":115091469,"number":16,"title":"Can't connect remotely to a server","user":{"login":"jbrodriguez","id":1305422,"avatar_url":"https://avatars.githubusercontent.com/u/1305422?v=3","gravatar_id":"","url":"https://api.github.com/users/jbrodriguez","html_url":"https://github.com/jbrodriguez","followers_url":"https://api.github.com/users/jbrodriguez/followers","following_url":"https://api.github.com/users/jbrodriguez/following{/other_user}","gists_url":"https://api.github.com/users/jbrodriguez/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrodriguez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrodriguez/subscriptions","organizations_url":"https://api.github.com/users/jbrodriguez/orgs","repos_url":"https://api.github.com/users/jbrodriguez/repos","events_url":"https://api.github.com/users/jbrodriguez/events{/privacy}","received_events_url":"https://api.github.com/users/jbrodriguez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-11-04T16:25:42Z","updated_at":"2015-11-04T22:31:26Z","closed_at":null,"body":"Hi\r\n\r\nI have a client running on 'blackbeard' machine and a server running on 'wopr' machine.\r\n\r\nThe consul server is running on blackbeard and a consul agent is running on wopr.\r\n\r\nThis is the consul server\r\n```\r\n⟩ env GOMAXPROCS=4 consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul\r\n==> WARNING: BootstrapExpect Mode is specified as 1; this is the same as Bootstrap mode.\r\n==> WARNING: Bootstrap mode enabled! Do not enable unless necessary\r\n==> Starting raft data migration...\r\n==> Starting Consul agent...\r\n==> Starting Consul agent RPC...\r\n==> Consul agent running!\r\n         Node name: 'blackbeard'\r\n        Datacenter: 'dc1'\r\n            Server: true (bootstrap: true)\r\n       Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400)\r\n      Cluster Addr: 192.168.23.23 (LAN: 8301, WAN: 8302)\r\n    Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false\r\n             Atlas: <disabled>\r\n\r\n==> Log data will now stream in as it occurs:\r\n\r\n    2015/11/04 10:50:08 [INFO] raft: Node at 192.168.23.23:8300 [Follower] entering Follower state\r\n    2015/11/04 10:50:08 [INFO] serf: EventMemberJoin: blackbeard 192.168.23.23\r\n    2015/11/04 10:50:08 [INFO] consul: adding server blackbeard (Addr: 192.168.23.23:8300) (DC: dc1)\r\n    2015/11/04 10:50:08 [INFO] serf: EventMemberJoin: blackbeard.dc1 192.168.23.23\r\n    2015/11/04 10:50:08 [INFO] consul: adding server blackbeard.dc1 (Addr: 192.168.23.23:8300) (DC: dc1)\r\n    2015/11/04 10:50:08 [ERR] agent: failed to sync remote state: No cluster leader\r\n    2015/11/04 10:50:09 [WARN] raft: Heartbeat timeout reached, starting election\r\n    2015/11/04 10:50:09 [INFO] raft: Node at 192.168.23.23:8300 [Candidate] entering Candidate state\r\n    2015/11/04 10:50:09 [INFO] raft: Election won. Tally: 1\r\n    2015/11/04 10:50:09 [INFO] raft: Node at 192.168.23.23:8300 [Leader] entering Leader state\r\n    2015/11/04 10:50:09 [INFO] consul: cluster leadership acquired\r\n    2015/11/04 10:50:09 [INFO] consul: New leader elected: blackbeard\r\n    2015/11/04 10:50:09 [INFO] raft: Disabling EnableSingleNode (bootstrap)\r\n    2015/11/04 10:54:47 [INFO] agent: Deregistered service 'io.jbrodriguez.mediagui.scanner-47b07d7d-827e-11e5-81dc-d05099660776'\r\n    2015/11/04 10:56:59 [INFO] agent: Deregistered service 'io.jbrodriguez.mediagui.scanner-47b07d7d-827e-11e5-81dc-d05099660776'\r\n    2015/11/04 11:02:29 [INFO] serf: EventMemberJoin: wopr 192.168.23.72\r\n    2015/11/04 11:02:29 [INFO] consul: member 'wopr' joined, marking health alive\r\n    2015/11/04 11:12:30 [ERR] yamux: Failed to write header: use of closed network connection\r\n```\r\n\r\nThis is the consult agent (client)\r\n```\r\nroot@wopr:~# /boot/consul agent -data-dir /tmp/consul -join blackbeard.apertoire.org\r\n==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1\r\n==> Starting Consul agent...\r\n==> Starting Consul agent RPC...\r\n==> Joining cluster...\r\n    Join completed. Synced with 1 initial agents\r\n==> Consul agent running!\r\n         Node name: 'wopr'\r\n        Datacenter: 'dc1'\r\n            Server: false (bootstrap: false)\r\n       Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400)\r\n      Cluster Addr: 192.168.23.72 (LAN: 8301, WAN: 8302)\r\n    Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false\r\n             Atlas: <disabled>\r\n\r\n==> Log data will now stream in as it occurs:\r\n\r\n    2015/11/04 11:02:29 [INFO] serf: EventMemberJoin: wopr 192.168.23.72\r\n    2015/11/04 11:02:29 [INFO] agent: (LAN) joining: [blackbeard.apertoire.org]\r\n    2015/11/04 11:02:29 [INFO] serf: EventMemberJoin: blackbeard 192.168.23.23\r\n    2015/11/04 11:02:29 [INFO] agent: (LAN) joined: 1 Err: <nil>\r\n    2015/11/04 11:02:29 [ERR] agent: failed to sync remote state: No known Consul servers\r\n    2015/11/04 11:02:29 [INFO] consul: adding server blackbeard (Addr: 192.168.23.23:8300) (DC: dc1)\r\n```\r\n\r\n\r\nThis is the server\r\n```\r\nroot@wopr:~# /boot/scanner -logtostderr\r\nI1104 11:05:08.097673   25766 scanner.go:18] after parse\r\nI1104 11:05:08.097767   25766 server.go:96] Starting server io.jbrodriguez.mediagui.scanner id io.jbrodriguez.mediagui.scanner-d1b784a8-830d-11e5-a519-d05099660776\r\nI1104 11:05:08.097850   25766 rpc_server.go:222] Listening on 0.0.0.0:58719\r\nI1104 11:05:08.097909   25766 http_broker.go:80] Broker Listening on 0.0.0.0:57574\r\nI1104 11:05:08.097968   25766 rpc_server.go:152] Registering node: io.jbrodriguez.mediagui.scanner-d1b784a8-830d-11e5-a519-d05099660776\r\nI1104 11:10:09.004940   25766 handler.go:19] Received scanner.Scan request: %vfolders:\"/mnt/user/films\"\r\nI1104 11:10:18.540523   25766 handler.go:19] Received scanner.Scan request: %vfolders:\"/mnt/user/films\"\r\nI1104 11:10:31.820802   25766 handler.go:19] Received scanner.Scan request: %vfolders:\"/mnt/user/films\"\r\n```\r\n\r\nThis is the output of http://localhost:8500/v1/catalog/service/io.jbrodriguez.mediagui.scanner, run on blackbeard\r\n```\r\n[\r\n  {\r\n    \"Node\": \"io.jbrodriguez.mediagui.scanner-d1b784a8-830d-11e5-a519-d05099660776\",\r\n    \"Address\": \"0.0.0.0\",\r\n    \"ServiceID\": \"io.jbrodriguez.mediagui.scanner-d1b784a8-830d-11e5-a519-d05099660776\",\r\n    \"ServiceName\": \"io.jbrodriguez.mediagui.scanner\",\r\n    \"ServiceTags\": [\r\n      \"e={\\\"Name\\\":\\\"Scanner.Scan\\\",\\\"Request\\\":{\\\"Name\\\":\\\"Request\\\",\\\"Type\\\":\\\"Request\\\",\\\"Values\\\":[{\\\"Name\\\":\\\"Folders\\\",\\\"Type\\\":\\\"\\\",\\\"Values\\\":null}]},\\\"Response\\\":{\\\"Name\\\":\\\"Response\\\",\\\"Type\\\":\\\"Response\\\",\\\"Values\\\":[{\\\"Name\\\":\\\"Filenames\\\",\\\"Type\\\":\\\"\\\",\\\"Values\\\":null}]},\\\"Metadata\\\":{\\\"stream\\\":\\\"false\\\"}}\",\r\n      \"e={\\\"Name\\\":\\\"Debug.Health\\\",\\\"Request\\\":{\\\"Name\\\":\\\"Request\\\",\\\"Type\\\":\\\"Request\\\",\\\"Values\\\":null},\\\"Response\\\":{\\\"Name\\\":\\\"Response\\\",\\\"Type\\\":\\\"Response\\\",\\\"Values\\\":[{\\\"Name\\\":\\\"Status\\\",\\\"Type\\\":\\\"string\\\",\\\"Values\\\":null}]},\\\"Metadata\\\":{\\\"stream\\\":\\\"false\\\"}}\"\r\n    ],\r\n    \"ServiceAddress\": \"\",\r\n    \"ServicePort\": 58719\r\n  }\r\n]\r\n```\r\n\r\nBut the client fails to connect to server\r\n```\r\n⟩ ./test -logtostderr\r\nI1104 11:10:28.359626   25332 main.go:25] req=&{service:io.jbrodriguez.mediagui.scanner method:Scanner.Scan contentType:application/octet-stream request:0xc82000b160}\r\nW1104 11:10:28.360803   25332 main.go:31] Unable to connect to scanning service: %s{\"id\":\"go.micro.client\",\"code\":500,\"detail\":\"Error sending request: dial tcp 0.0.0.0:58719: getsockopt: connection refused\",\"status\":\"Internal Server Error\"}\r\n```\r\n\r\nIf I run the client on wopr, it works"},"comment":{"url":"https://api.github.com/repos/myodc/go-micro/issues/comments/153890471","html_url":"https://github.com/myodc/go-micro/issues/16#issuecomment-153890471","issue_url":"https://api.github.com/repos/myodc/go-micro/issues/16","id":153890471,"user":{"login":"asim","id":17530,"avatar_url":"https://avatars.githubusercontent.com/u/17530?v=3","gravatar_id":"","url":"https://api.github.com/users/asim","html_url":"https://github.com/asim","followers_url":"https://api.github.com/users/asim/followers","following_url":"https://api.github.com/users/asim/following{/other_user}","gists_url":"https://api.github.com/users/asim/gists{/gist_id}","starred_url":"https://api.github.com/users/asim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asim/subscriptions","organizations_url":"https://api.github.com/users/asim/orgs","repos_url":"https://api.github.com/users/asim/repos","events_url":"https://api.github.com/users/asim/events{/privacy}","received_events_url":"https://api.github.com/users/asim/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T22:31:26Z","updated_at":"2015-11-04T22:31:26Z","body":"Did you do go get -u? Perhaps the library was not rebuilt the first time. The behaviour suggests it wasn't updated."}}