New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeconfig without a current-context crashes telepresence. #164

philips opened this Issue Jun 7, 2017 · 3 comments


None yet
2 participants

philips commented Jun 7, 2017

What were you trying to do?

telepresence -m inject-tcp -n test --run-shell

What did you expect to happen?

Working shell

What happened instead?


I am using a Tectonic cluster and the kubeconfig doesn't include a cluster-context entry in the yaml. By adding the following to the bottom of my kubeconfig this bug went away.

  name: local
current-context: local

Automatically included information

Command line: ['/usr/local/bin/telepresence', '-m', 'inject-tcp', '-n', 'test', '--run-shell']
Version: 0.49
Python version: 3.6.1 (default, Apr 7 2017, 18:53:53) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
kubectl version: Client Version: v1.7.0-alpha.4
oc version: (error: [Errno 2] No such file or directory: 'oc')
OS: Darwin Brandons-MacBook-Pro.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64

Traceback (most recent call last):
  File "/usr/local/bin/telepresence", line 95, in call_f
    return f(*args, **kwargs)
  File "/usr/local/bin/telepresence", line 1452, in go
    runner, remote_info, args, env, subprocesses, socks_port, ssh_port
  File "/usr/local/bin/telepresence", line 1210, in run_local_command
    runner.kubectl_cmd, "config", "current-context"
  File "/usr/local/bin/telepresence", line 198, in get_output
    **kwargs).strip(), "utf-8"
  File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/", line 336, in check_output
  File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['kubectl', 'config', 'current-context']' returned non-zero exit status 1.


rictHostKeyChecking=no', '-oUserKnownHostsFile=/dev/null', 'telepresence@localhost', '/bin/true'],)... Running: (['ssh', '-q', '-p', '52928', '-oStrictHostKeyChecking=no', '-oUserKnownHostsFile=/dev/null', 'telepresence@localhost', '/bin/true'],)... Forwarding from -> 8022
Forwarding from [::1]:52928 -> 8022
Running: (['ssh', '-q', '-p', '52928', '-oStrictHostKeyChecking=no', '-oUserKnownHostsFile=/dev/null', 'telepresence@localhost', '/bin/true'],)... Handling connection for 52928
Running: (['ssh', '-q', '-oStrictHostKeyChecking=no', '-oUserKnownHostsFile=/dev/null', '-oServerAliveInterval=1', '-oServerAliveCountMax=10', '-N', '-p', '52928', 'telepresence@localhost', '-L', ''],)...Running: (['kubectl', '--context', '', '--namespace', 'default', 'exec', 'test-3321722284-0h828', '--container', 'test', 'env'],)...Handling connection for 52928
Running: (['kubectl', 'config', 'current-context'],)...error: current-context is not set


This comment has been minimized.


itamarst commented Jun 8, 2017

Thanks for the bug report! I'll try to get this fixed.

@itamarst itamarst added the bug label Jun 8, 2017

@itamarst itamarst added this to In progress in Telepresence Jun 8, 2017

This was referenced Jun 8, 2017

@itamarst itamarst closed this in #166 Jun 8, 2017

itamarst added a commit that referenced this issue Jun 8, 2017

Merge pull request #166 from datawire/missing-context
Missing context.

Fixes #164.
Fixes #165.

@itamarst itamarst moved this from In progress to Done in Telepresence Jun 8, 2017


This comment has been minimized.


itamarst commented Jun 8, 2017

@philips I just released v0.50 with fixes for your two bugs. Let me know if you have any other problems!

What's your use case for Telepresence, by the way?


This comment has been minimized.

philips commented Jun 9, 2017

Just trying it out, neat project, good work!

@itamarst itamarst removed this from Done in Telepresence Jun 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment