Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Midas API throws 500 when trying to authenticate without a Default API key #63

Closed
mgrauer opened this issue Aug 19, 2014 · 2 comments
Closed
Labels

Comments

@mgrauer
Copy link
Contributor

mgrauer commented Aug 19, 2014

@sankhesh found this when trying to use Pydas. He logged into a midas system, and had an API key with a name that wasn't Default, but no Default API key. He got a 500 with this stack trace:

Caught PydasException: 'Request failed with HTTP error code 500'
Waiting 5 seconds, then retrying request
Caught PydasException: u'Request failed with Midas error code -150: Unable to authenticate. Please check credentials.'
Waiting 5 seconds, then retrying request
^CTraceback (most recent call last):
File "", line 1, in
File "build/bdist.linux-x86_64/egg/pydas/api.py", line 71, in login
File "build/bdist.linux-x86_64/egg/pydas/drivers.py", line 216, in get_default_api_key
File "build/bdist.linux-x86_64/egg/pydas/retry.py", line 63, in wrapper
File "build/bdist.linux-x86_64/egg/pydas/drivers.py", line 153, in login_with_api_key
File "build/bdist.linux-x86_64/egg/pydas/retry.py", line 57, in wrapper

and in the Midas logs

Fatal Error: Array
(
[type] => 1
[message] => Call to a member function getApikey() on a non-object
[file] => /data/www/midas/core/controllers/components/ApisystemComponent.php
[line] => 190
[typeText] => E_ERROR
)

@mgrauer
Copy link
Contributor Author

mgrauer commented Aug 19, 2014

When I said

He logged into a midas system

I meant he attempted to call pydas.login().

Should have been more clear.

@jamiesnape jamiesnape added the bug label Oct 6, 2014
@jamiesnape
Copy link
Contributor

That line number corresponds to the midas.user.apikey.default (RPC) or /system/defaultapikey (REST) API calls, which are never called by any other method on the server. Therefore, this is either a bug or feature related to Pydas with respect to the following line: https://github.com/midasplatform/pydas/blob/master/pydas/api.py#L70

@jamiesnape jamiesnape added invalid and removed bug labels Oct 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants