Skip to content
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

deis controller throws 500 with badly padded key #31

Open
Cryptophobia opened this issue Mar 20, 2018 · 4 comments
Open

deis controller throws 500 with badly padded key #31

Cryptophobia opened this issue Mar 20, 2018 · 4 comments
Labels

Comments

@Cryptophobia
Copy link
Member

From @deis-admin on January 19, 2017 23:44

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

Copied from original issue: deis/controller#1228

@Cryptophobia
Copy link
Member Author

From @deis-admin on January 19, 2017 23:44

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

@Cryptophobia
Copy link
Member Author

From @deis-admin on January 19, 2017 23:44

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"

@Cryptophobia
Copy link
Member Author

From @deis-admin on January 19, 2017 23:44

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

@Cryptophobia
Copy link
Member Author

From @deis-admin on January 19, 2017 23:44

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.

duanhongyi added a commit to duanhongyi/controller that referenced this issue Nov 26, 2021
chore(controller): modify database config && remove redis port config…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant