{"action":"created","issue":{"url":"https://api.github.com/repos/datawire/telepresence/issues/365","repository_url":"https://api.github.com/repos/datawire/telepresence","labels_url":"https://api.github.com/repos/datawire/telepresence/issues/365/labels{/name}","comments_url":"https://api.github.com/repos/datawire/telepresence/issues/365/comments","events_url":"https://api.github.com/repos/datawire/telepresence/issues/365/events","html_url":"https://github.com/datawire/telepresence/issues/365","id":281798959,"number":365,"title":"Telepresence does not use the correct context in every call to kubectl","user":{"login":"exarkun","id":254565,"avatar_url":"https://avatars1.githubusercontent.com/u/254565?v=4","gravatar_id":"","url":"https://api.github.com/users/exarkun","html_url":"https://github.com/exarkun","followers_url":"https://api.github.com/users/exarkun/followers","following_url":"https://api.github.com/users/exarkun/following{/other_user}","gists_url":"https://api.github.com/users/exarkun/gists{/gist_id}","starred_url":"https://api.github.com/users/exarkun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exarkun/subscriptions","organizations_url":"https://api.github.com/users/exarkun/orgs","repos_url":"https://api.github.com/users/exarkun/repos","events_url":"https://api.github.com/users/exarkun/events{/privacy}","received_events_url":"https://api.github.com/users/exarkun/received_events","type":"User","site_admin":false},"labels":[{"id":546271572,"url":"https://api.github.com/repos/datawire/telepresence/labels/bug","name":"bug","color":"f9d0c4","default":true},{"id":735750587,"url":"https://api.github.com/repos/datawire/telepresence/labels/crash%20instead%20of%20error","name":"crash instead of error","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-12-13T15:53:10Z","updated_at":"2018-04-09T17:57:15Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### What were you trying to do?\r\n\r\nTrying to reproduce the \"Quick example\" from https://www.telepresence.io/tutorials/docker\r\n\r\n```\r\nkubectl run qotm --image=datawire/qotm:1.3 --port=5000 --expose\r\ntelepresence --docker-run -i -t alpine /bin/sh\r\n```\r\n\r\n### What did you expect to happen?\r\n\r\nA shell running in a Docker container running the alpine image where I could poke at a qotm server.\r\n\r\n### What happened instead?\r\n\r\nSeveral exceptions reported by telepresence but no shell in a Docker container.  This shows up in the logs:\r\n\r\n```\r\nUnable to connect to the server: dial tcp 192.168.99.100:8443: i/o timeout\r\n```\r\n\r\nbut it's also the first line of output from the telepresence command.\r\n\r\n### Automatically included information\r\n\r\nCommand line: `['/usr/bin/telepresence', '--context', 'staging', '--docker-run', '-i', '-t', 'alpine', '/bin/sh']`\r\nVersion: `0.68`\r\nPython version: `3.5.2+ (default, Sep 22 2016, 12:18:14) \r\n[GCC 6.2.0 20160927]`\r\nkubectl version: `Client Version: v1.6.4`\r\noc version: `(error: [Errno 2] No such file or directory: 'oc')`\r\nOS: `Linux baryon 4.8.0-59-generic #64-Ubuntu SMP Thu Jun 29 19:38:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux`\r\nTraceback:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/telepresence\", line 1785, in get_proxy_cidrs\r\n    get_output([runner.kubectl_cmd, \"get\", \"nodes\", \"-o\", \"json\"])\r\n  File \"/usr/bin/telepresence\", line 395, in get_output\r\n    result = unicode(check_output(*args, **kwargs).strip(), \"utf-8\")\r\n  File \"/usr/lib/python3.5/subprocess.py\", line 626, in check_output\r\n    **kwargs).stdout\r\n  File \"/usr/lib/python3.5/subprocess.py\", line 708, in run\r\n    output=stdout, stderr=stderr)\r\nsubprocess.CalledProcessError: Command '['kubectl', 'get', 'nodes', '-o', 'json']' returned non-zero exit status 1\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/telepresence\", line 257, in call_f\r\n    return f(*args, **kwargs)\r\n  File \"/usr/bin/telepresence\", line 2379, in go\r\n    ssh,\r\n  File \"/usr/bin/telepresence\", line 1978, in run_docker_command\r\n    runner, args, remote_info, remote_env[\"KUBERNETES_SERVICE_HOST\"]\r\n  File \"/usr/bin/telepresence\", line 1792, in get_proxy_cidrs\r\n    get_output([runner.kubectl_cmd, \"get\", \"pods\", \"-o\", \"json\"])\r\n  File \"/usr/bin/telepresence\", line 395, in get_output\r\n    result = unicode(check_output(*args, **kwargs).strip(), \"utf-8\")\r\n  File \"/usr/lib/python3.5/subprocess.py\", line 626, in check_output\r\n    **kwargs).stdout\r\n  File \"/usr/lib/python3.5/subprocess.py\", line 708, in run\r\n    output=stdout, stderr=stderr)\r\nsubprocess.CalledProcessError: Command '['kubectl', 'get', 'pods', '-o', 'json']' returned non-zero exit status 1\r\n\r\n```\r\n\r\nLogs:\r\n\r\n```\r\n:44+0000 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.\r\n   8.9 TL | [19] ran.\r\n   8.9 TL | [20] Capturing: (['kubectl', '--context', 'staging', '--namespace', 'default', 'exec', '--container=telepresence-1513177985-1553378-9170', 'telepresence-1513177985-1553378-9170-2313679694-rf6xp', '--', 'python3', '-c', '\\nimport socket, sys, json\\n\\nresult = []\\nfor host in sys.argv[1:]:\\n    result.append(socket.gethostbyname(host))\\nsys.stdout.write(json.dumps(result))\\nsys.stdout.flush()\\n'],)...\r\n  10.3 TL | [20] captured.\r\n  10.3 TL | [21] Capturing: (['kubectl', 'get', 'nodes', '-o', 'json'],)...\r\nUnable to connect to the server: dial tcp 192.168.99.100:8443: i/o timeout\r\n  40.4 TL | Failed to get nodes: Command '['kubectl', 'get', 'nodes', '-o', 'json']' returned non-zero exit status 1\r\n  40.4 TL | [22] Capturing: (['kubectl', 'get', 'pods', '-o', 'json'],)...\r\nUnable to connect to the server: dial tcp 192.168.99.100:8443: i/o timeout\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/datawire/telepresence/issues/comments/379839152","html_url":"https://github.com/datawire/telepresence/issues/365#issuecomment-379839152","issue_url":"https://api.github.com/repos/datawire/telepresence/issues/365","id":379839152,"user":{"login":"ark3","id":1765854,"avatar_url":"https://avatars0.githubusercontent.com/u/1765854?v=4","gravatar_id":"","url":"https://api.github.com/users/ark3","html_url":"https://github.com/ark3","followers_url":"https://api.github.com/users/ark3/followers","following_url":"https://api.github.com/users/ark3/following{/other_user}","gists_url":"https://api.github.com/users/ark3/gists{/gist_id}","starred_url":"https://api.github.com/users/ark3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ark3/subscriptions","organizations_url":"https://api.github.com/users/ark3/orgs","repos_url":"https://api.github.com/users/ark3/repos","events_url":"https://api.github.com/users/ark3/events{/privacy}","received_events_url":"https://api.github.com/users/ark3/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T17:57:15Z","updated_at":"2018-04-09T17:57:15Z","author_association":"CONTRIBUTOR","body":"Some of the non-`runner.py` code imports the `subprocess` module just to grab types, exceptions, and constants (`Popen`, `CalledProcessError`, `STDOUT`). We can modify that code to grab those from `runner.py` instead. Then we can add a lint stage that detects `subprocess` imports outside of that file.\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"ark3"}}