{"action":"created","issue":{"url":"https://api.github.com/repos/vfarcic/docker-flow-proxy/issues/36","repository_url":"https://api.github.com/repos/vfarcic/docker-flow-proxy","labels_url":"https://api.github.com/repos/vfarcic/docker-flow-proxy/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/vfarcic/docker-flow-proxy/issues/36/comments","events_url":"https://api.github.com/repos/vfarcic/docker-flow-proxy/issues/36/events","html_url":"https://github.com/vfarcic/docker-flow-proxy/issues/36","id":173673092,"number":36,"title":"Reconfigure Errors w. Consul","user":{"login":"Thomas0c","id":8699937,"avatar_url":"https://avatars.githubusercontent.com/u/8699937?v=3","gravatar_id":"","url":"https://api.github.com/users/Thomas0c","html_url":"https://github.com/Thomas0c","followers_url":"https://api.github.com/users/Thomas0c/followers","following_url":"https://api.github.com/users/Thomas0c/following{/other_user}","gists_url":"https://api.github.com/users/Thomas0c/gists{/gist_id}","starred_url":"https://api.github.com/users/Thomas0c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thomas0c/subscriptions","organizations_url":"https://api.github.com/users/Thomas0c/orgs","repos_url":"https://api.github.com/users/Thomas0c/repos","events_url":"https://api.github.com/users/Thomas0c/events{/privacy}","received_events_url":"https://api.github.com/users/Thomas0c/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-28T23:02:28Z","updated_at":"2016-08-29T00:32:52Z","closed_at":null,"body":"After adding Consul instances to my Docker Swarm Mode managers and workers I'm now getting several errors from `docker-flow-proxy`. I'm struggling identifying the cause of the problem and have both Consul and containers that are being `curl` healthy and running when getting outputs as can be seen below:\r\n\r\nHoping you can provide some insight and possible pinpoint why these errors occur.\r\n\r\nE.g. if I run `curl \"localhost:8080/v1/docker-flow-proxy/reconfigure?serviceName=my-service&servicePath=/&serviceDomain=sub.mydomain.com&port=5000&distribute=true\"` I get:\r\n```{\"Status\":\"NOK\",\"Message\":\"Could not send distribute request to the following addresses: [10.0.0.3 10.0.0.12]\",\"ServiceName\":\"my-service\",\"ServiceColor\":\"\",\"ServicePath\":[\"/\"],\"ServiceDomain\":\"sub.mydomain.com\",\"ConsulTemplateFePath\":\"\",\"ConsulTemplateBePath\":\"\",\"PathType\":\"\",\"SkipCheck\":false,\"Mode\":\"swarm\",\"Port\":\"5000\",\"Distribute\":true}```\r\n\r\nIf I retrieve logs from the `docker-flow-proxy` containers this is what I get:\r\n\r\n```\r\n2016/08/28 22:39:40 Processing request /v1/docker-flow-proxy/reconfigure?serviceName=my-service&servicePath=/&port=5000\r\n2016/08/28 22:39:40 Creating configuration for the service my-service\r\n2016/08/28 22:39:40 Reloading the proxy\r\n[ALERT] 240/223940 (24) : parsing [/cfg/haproxy.cfg:37] : 'server my-service' : invalid address: 'my-service' in 'my-service:5000'\r\n\r\n[ALERT] 240/230158 (37) : Error(s) found in configuration file : /cfg/haproxy.cfg\r\n[ALERT] 240/230158 (37) : Fatal errors found in configuration.\r\n2016/08/28 22:39:40 http: multiple response.WriteHeader calls\r\n```\r\n\r\nWhile if I try to `curl` to remove the settings including `distribute=true` everything seems to be working:\r\n\r\nOutput from console:\r\n`{\"Status\":\"OK\",\"Message\":\"Distributed to all instances\",\"ServiceName\":\"my-service\",\"ServiceColor\":\"\",\"ServicePath\":null,\"ServiceDomain\":\"\",\"ConsulTemplateFePath\":\"\",\"ConsulTemplateBePath\":\"\",\"PathType\":\"\",\"SkipCheck\":false,\"Mode\":\"\",\"Port\":\"\",\"Distribute\":true}`\r\n\r\n\r\nLog from `docker-flow-proxy`:\r\n```\r\n2016/08/28 22:47:06 Processing request /v1/docker-flow-proxy/remove?serviceName=my-service&distribute=true\r\n2016/08/28 22:47:06 Sending distribution request to http://10.0.0.12:8080/v1/docker-flow-proxy/remove?distribute=false&serviceName=my-service\r\n2016/08/28 22:47:06 Processing request /v1/docker-flow-proxy/remove?distribute=false&serviceName=my-service\r\n2016/08/28 22:47:06 Processing remove request /v1/docker-flow-proxy/remove\r\n2016/08/28 22:47:06 Removing my-service configuration\r\n2016/08/28 22:47:06 Removing the my-service configuration files\r\n2016/08/28 22:47:06 remove /cfg/tmpl/my-service-fe.cfg: no such file or directory\r\n2016/08/28 22:47:06 Sending distribution request to http://10.0.0.3:8080/v1/docker-flow-proxy/remove?distribute=false&serviceName=my-service\r\n```\r\n\r\nIf I try to configure a proxy w/o `distribute=true` this is what I'm getting:\r\n```\r\n{\"Status\":\"NOK\",\"Message\":\"Command haproxy -f /cfg/haproxy.cfg -D -p /var/run/haproxy.pid -sf 33\\n\\nexit status 1\\nglobal\\n    pidfile /var/run/haproxy.pid\\n\\ndefaults\\n    mode    http\\n    balance roundrobin\\n\\n    option  dontlognull\\n    option  dontlog-normal\\n    option  forwardfor\\n    option  redispatch\\n\\n    maxconn 5000\\n    timeout connect 5s\\n    timeout client  20s\\n    timeout server  20s\\n    timeout my-service   30s\\n    timeout http-request 5s\\n    timeout http-keep-alive 15s\\n\\n    stats enable\\n    stats refresh 30s\\n    stats realm Strictly\\\\ Private\\n    stats auth admin:admin\\n    stats uri /admin?stats\\n\\nfrontend services\\n    bind *:80\\n    bind *:443\\n    option http-server-close\\n\\n\\n    acl url_my-service path_beg /\\n    acl domain_my-service hdr_dom(host) -i sub.my-domain.com\\n    use_backend my-service-be if url_my-service domain_my-service\\n\\nbackend my-service-be\\n    server my-service my-service:8000\",\"ServiceName\":\"my-service\",\"ServiceColor\":\"\",\"ServicePath\":[\"/\"],\"ServiceDomain\":\"sub.my-domain.com\",\"ConsulTemplateFePath\":\"\",\"ConsulTemplateBePath\":\"\",\"PathType\":\"\",\"SkipCheck\":false,\"Mode\":\"swarm\",\"Port\":\"8000\",\"Distribute\":false}\r\n```"},"comment":{"url":"https://api.github.com/repos/vfarcic/docker-flow-proxy/issues/comments/243009642","html_url":"https://github.com/vfarcic/docker-flow-proxy/issues/36#issuecomment-243009642","issue_url":"https://api.github.com/repos/vfarcic/docker-flow-proxy/issues/36","id":243009642,"user":{"login":"Thomas0c","id":8699937,"avatar_url":"https://avatars.githubusercontent.com/u/8699937?v=3","gravatar_id":"","url":"https://api.github.com/users/Thomas0c","html_url":"https://github.com/Thomas0c","followers_url":"https://api.github.com/users/Thomas0c/followers","following_url":"https://api.github.com/users/Thomas0c/following{/other_user}","gists_url":"https://api.github.com/users/Thomas0c/gists{/gist_id}","starred_url":"https://api.github.com/users/Thomas0c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thomas0c/subscriptions","organizations_url":"https://api.github.com/users/Thomas0c/orgs","repos_url":"https://api.github.com/users/Thomas0c/repos","events_url":"https://api.github.com/users/Thomas0c/events{/privacy}","received_events_url":"https://api.github.com/users/Thomas0c/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T00:32:52Z","updated_at":"2016-08-29T00:32:52Z","body":"Just tested. I'm not getting an answer, but instead `Authority`:\r\n```\r\n;; ->>HEADER<<- opcode: QUERY, rcode: NXDOMAIN, id: 29701\r\n;; flags: qr rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0\r\n;; QUESTION SECTION:\r\n;; 172.10.10.1.       \tIN     \tA\r\n\r\n;; ANSWER SECTION:\r\n\r\n;; AUTHORITY SECTION:\r\n.      \t60     \tIN     \tSOA    \ta.root-servers.net. nstld.verisign-grs.com. 2016082801 1800 900 604800 86400\r\n\r\n;; ADDITIONAL SECTION:\r\n\r\n;; Query time: 2 msec\r\n;; SERVER: 127.0.0.11\r\n;; WHEN: Mon Aug 29 00:25:40 2016\r\n;; MSG SIZE  rcvd: 105\r\n```\r\n\r\nWhat time zone are you in? I'm happy to hop on Skype on Wednesday and am pretty flexible. Username is thomasoc05."}}
{"actor":{"display_login":"Thomas0c"}}