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

Traceback if run against non-existent Deployment #592

Closed
containscafeine opened this Issue Apr 13, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@containscafeine
Copy link
Contributor

containscafeine commented Apr 13, 2018

What were you trying to do?

Trying to run telepresence against a Deployment in the cluster that did not exist at the time

What did you expect to happen?

Expected a nice message saying - "Deployment xyz does not exist"

What happened instead?

Automatically included information

Command line: ['/usr/bin/telepresence', '--verbose', '--swap-deployment', 'qotm', '--expose', '80:5000', '--docker-run', '-it', 'nginx']
Version: 0.81
Python version: 3.6.4 (default, Mar 13 2018, 18:18:20) [GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]
kubectl version: Client Version: v1.9.0 // Server Version: v1.10.0
oc version: oc v3.7.1+ab0f056 // kubernetes v1.7.6+a08f5eeb62 // features: Basic-Auth GSSAPI Kerberos SPNEGO // // Server https://192.168.39.107:8443 // kubernetes v1.10.0
OS: Linux containscafeine 4.15.14-300.fc27.x86_64 #1 SMP Thu Mar 29 16:13:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Traceback:

Traceback (most recent call last):
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/remote.py", line 87, in get_deployment_json
    stderr=STDOUT
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/runner.py", line 277, in get_kubectl
    self.kubectl(context, namespace, args), stderr=stderr
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/runner.py", line 234, in get_output
    track, "Capturing", "captured", out_cb, err_cb, args, **kwargs
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/runner.py", line 212, in run_command
    raise CalledProcessError(retcode, args)
subprocess.CalledProcessError: Command '['kubectl', '--v=4', '--context', 'minikube', '--namespace', 'newns', 'get', 'deployment', '-o', 'json', '--export', 'qotm']' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/cli.py", line 74, in call_f
    return f(*args, **kwargs)
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/main.py", line 494, in go_too
    runner, args
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/main.py", line 281, in start_proxy
    runner, args
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/deployment.py", line 97, in swap_deployment
    "deployment",
  File "/usr/share/telepresence/libexec/lib64/python3.6/site-packages/telepresence/remote.py", line 103, in get_deployment_json
    deployment_name, str(e.stdout, "utf-8")
TypeError: decoding to str: need a bytes-like object, NoneType found

Logs:

n)
   0.3 TEL | [8] Capturing: kubectl --v=4 --context minikube --namespace newns get deployment -o json --export qotm
   0.3   2 | 
   0.3   2 | Server https://192.168.39.107:8443
   0.3   2 | kubernetes v1.10.0
   0.3 TEL | [2] exit 0
   0.5   8 | I0413 14:34:38.307045   10660 helpers.go:201] server response object: [{
   0.5   8 |   "kind": "Status",
   0.5   8 |   "apiVersion": "v1",
   0.5   8 |   "metadata": {},
   0.5   8 |   "status": "Failure",
   0.5   8 |   "message": "deployments.extensions \"qotm\" not found",
   0.5   8 |   "reason": "NotFound",
   0.5   8 |   "details": {
   0.5   8 |     "name": "qotm",
   0.5   8 |     "group": "extensions",
   0.5   8 |     "kind": "deployments"
   0.5   8 |   },
   0.5   8 |   "code": 404
   0.5   8 | }]
   0.5   8 | F0413 14:34:38.307094   10660 helpers.go:119] Error from server (NotFound): deployments.extensions "qotm" not found
   0.5 TEL | [8] exit 255 in 0.15 secs.
   0.5 TEL | END SPAN remote.py:72(get_deployment_json)    0.1s

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