{"action":"created","issue":{"url":"https://api.github.com/repos/rancher/rancher/issues/2978","labels_url":"https://api.github.com/repos/rancher/rancher/issues/2978/labels{/name}","comments_url":"https://api.github.com/repos/rancher/rancher/issues/2978/comments","events_url":"https://api.github.com/repos/rancher/rancher/issues/2978/events","html_url":"https://github.com/rancher/rancher/issues/2978","id":121480021,"number":2978,"title":"Error with rancher/agent when adding localhost with custom host ","user":{"login":"tychota","id":13785185,"avatar_url":"https://avatars.githubusercontent.com/u/13785185?v=3","gravatar_id":"","url":"https://api.github.com/users/tychota","html_url":"https://github.com/tychota","followers_url":"https://api.github.com/users/tychota/followers","following_url":"https://api.github.com/users/tychota/following{/other_user}","gists_url":"https://api.github.com/users/tychota/gists{/gist_id}","starred_url":"https://api.github.com/users/tychota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tychota/subscriptions","organizations_url":"https://api.github.com/users/tychota/orgs","repos_url":"https://api.github.com/users/tychota/repos","events_url":"https://api.github.com/users/tychota/events{/privacy}","received_events_url":"https://api.github.com/users/tychota/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-10T13:08:02Z","updated_at":"2015-12-22T18:00:09Z","closed_at":null,"body":"On `Ubuntu Wily`, `Docker version 1.9.1, build a34a1d5`\r\nwith the following Docker images :\r\n\r\nhash                  | tag             | image\r\n--------------------|-----------------|------------\r\n0875c358b79b  | latest          | rancher/server\r\nbd417032148c  | v0.8.2         | rancher/agent\r\n\r\nwhen trying to install agent on my local machine, following the command UI gives me (custom host) : \r\n\r\n```bash\r\nsudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.8.2 http://localhost:8080/v1/scripts/redacted1:redacted2:redacted3\r\n```\r\nthe docker agent container exit rapidly.\r\nBrowsing the container logs with `docker logs hash` gives me: \r\n\r\n```pytb\r\nTraceback (most recent call last):\r\n  File \"./register.py\", line 11, in <module>\r\n    secret_key=os.environ['CATTLE_REGISTRATION_SECRET_KEY'])\r\n  File \"/usr/local/lib/python2.7/dist-packages/cattle.py\", line 37, in from_env\r\n    return gdapi.from_env(prefix=prefix, factory=Client, **kw)\r\n  File \"/usr/local/lib/python2.7/dist-packages/gdapi.py\", line 608, in from_env\r\n    return _from_env(prefix=prefix, factory=factory, **args)\r\n  File \"/usr/local/lib/python2.7/dist-packages/gdapi.py\", line 627, in _from_env\r\n    return factory(**result)\r\n  File \"/usr/local/lib/python2.7/dist-packages/cattle.py\", line 12, in __init__\r\n    super(Client, self).__init__(*args, **kw)\r\n  File \"/usr/local/lib/python2.7/dist-packages/gdapi.py\", line 195, in __init__\r\n    self._load_schemas()\r\n  File \"/usr/local/lib/python2.7/dist-packages/gdapi.py\", line 313, in _load_schemas\r\n    response = self._get_response(self._url)\r\n  File \"/usr/local/lib/python2.7/dist-packages/gdapi.py\", line 262, in _get_response\r\n    headers=self._headers)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 477, in get\r\n    return self.request('GET', url, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 465, in request\r\n    resp = self.send(prep, **send_kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 573, in send\r\n    r = adapter.send(request, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 415, in send\r\n    raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))\r\n```\r\n\r\nand no host appears on Host page in th UI."},"comment":{"url":"https://api.github.com/repos/rancher/rancher/issues/comments/166691230","html_url":"https://github.com/rancher/rancher/issues/2978#issuecomment-166691230","issue_url":"https://api.github.com/repos/rancher/rancher/issues/2978","id":166691230,"user":{"login":"deniseschannon","id":11410997,"avatar_url":"https://avatars.githubusercontent.com/u/11410997?v=3","gravatar_id":"","url":"https://api.github.com/users/deniseschannon","html_url":"https://github.com/deniseschannon","followers_url":"https://api.github.com/users/deniseschannon/followers","following_url":"https://api.github.com/users/deniseschannon/following{/other_user}","gists_url":"https://api.github.com/users/deniseschannon/gists{/gist_id}","starred_url":"https://api.github.com/users/deniseschannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniseschannon/subscriptions","organizations_url":"https://api.github.com/users/deniseschannon/orgs","repos_url":"https://api.github.com/users/deniseschannon/repos","events_url":"https://api.github.com/users/deniseschannon/events{/privacy}","received_events_url":"https://api.github.com/users/deniseschannon/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T18:00:09Z","updated_at":"2015-12-22T18:00:09Z","body":"Instead of using `localhost` in your host registration setup page, you should use the actual machine IP. \r\n\r\n\r\nSo in the docker run command, it would say `http://<server_IP>:8080/v1/scripts/redacted1:redacted2:redacted3`"}}