Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

deis controller throws 500 with badly padded key #1228

Open
deis-admin opened this issue Jan 19, 2017 · 5 comments
Open

deis controller throws 500 with badly padded key #1228

deis-admin opened this issue Jan 19, 2017 · 5 comments
Labels

Comments

@deis-admin
Copy link

From @bfosberry on May 21, 2015 21:2

May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: Traceback (most recent call last):
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: response = wrapped_callback(request, _callback_args, *_callback_kwargs)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: return view_func(_args, *_kwargs)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 85, in view
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: return self.dispatch(request, _args, *_kwargs)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 407, in dispatch
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: response = self.handle_exception(exc)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 404, in dispatch
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: response = handler(request, _args, *_kwargs)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/api/views.py", line 163, in run
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: output_and_rc = app.run(self.request.user, request.data['command'])
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/api/models.py", line 372, in run
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: return c.run(escaped_command)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/api/models.py", line 521, in run
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: rc, output = self._scheduler.run(job_id, image, entrypoint, command)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/scheduler/fleet.py", line 240, in run
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: file_obj = cStringIO.StringIO(base64.b64decode(self.pkey))
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/lib/python2.7/base64.py", line 76, in b64decode
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: raise TypeError(msg)
May 21 20:58:58 ip-10-12-13-195.ec2.internal sh[3317]: TypeError: Incorrect padding

Copied from original issue: deis/deis#3738

@deis-admin
Copy link
Author

From @bfosberry on May 21, 2015 21:5

This also happens should it be an invalid ssh key:

May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: Traceback (most recent call last):
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: response = wrapped_callback(request, *callback_args, **callback_kwargs)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: return view_func(*args, **kwargs)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 85, in view
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: return self.dispatch(request, *args, **kwargs)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 407, in dispatch
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: response = self.handle_exception(exc)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 404, in dispatch
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: response = handler(request, *args, **kwargs)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/api/views.py", line 163, in run
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: output_and_rc = app.run(self.request.user, request.data['command'])
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/api/models.py", line 372, in run
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: return c.run(escaped_command)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/api/models.py", line 521, in run
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: rc, output = self._scheduler.run(job_id, image, entrypoint, command)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/app/scheduler/fleet.py", line 241, in run
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: pkey = paramiko.RSAKey(file_obj=file_obj)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/paramiko/rsakey.py", line 52, in __init__
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: self._from_private_key(file_obj, password)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/paramiko/rsakey.py", line 169, in _from_private_key
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: data = self._read_private_key('RSA', file_obj, password)
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/paramiko/pkey.py", line 264, in _read_private_key
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: raise SSHException('not a valid ' + tag + ' private key file')
May 21 21:04:35 ip-10-12-13-195.ec2.internal sh[3317]: SSHException: not a valid RSA private key fil

@deis-admin
Copy link
Author

From @carmstrong on May 21, 2015 21:25

@gabrtv said "we should write up an issue so we throw a 400 w/ a nice error message instead of a 500"

@deis-admin
Copy link
Author

From @bfosberry on May 21, 2015 21:36

I think in the latest version (1.6.1) this comes out as a SSHException, not a TypeError

@deis-admin
Copy link
Author

From @bfosberry on May 21, 2015 21:38

Also the same for bad auth errors:

May 21 21:37:12 ip-10-12-13-195.ec2.internal sh[3317]: look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
May 21 21:37:12 ip-10-12-13-195.ec2.internal sh[3317]: File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line 519, in _auth
May 21 21:37:12 ip-10-12-13-195.ec2.internal sh[3317]: raise saved_exception
May 21 21:37:12 ip-10-12-13-195.ec2.internal sh[3317]: AuthenticationException: Authentication failed.

@Cryptophobia
Copy link
Contributor

This issue was moved to teamhephy/controller#31

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants