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

UnknownError exception name mismatch #16

Closed
kgutwin opened this issue Jul 2, 2015 · 6 comments
Closed

UnknownError exception name mismatch #16

kgutwin opened this issue Jul 2, 2015 · 6 comments
Labels

Comments

@kgutwin
Copy link

kgutwin commented Jul 2, 2015

After my token expires:

>>> client.is_authenticated()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/hvac/v1/__init__.py", line 270, in is_authenticated
    self.lookup_token()
  File "/usr/lib/python2.7/site-packages/hvac/v1/__init__.py", line 228, in lookup_token
    return self._get('/v1/auth/token/lookup-self').json()
  File "/usr/lib/python2.7/site-packages/hvac/v1/__init__.py", line 357, in _get
    return self.__request('get', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/hvac/v1/__init__.py", line 400, in __request
    raise exceptions.UnknownError()
AttributeError: 'module' object has no attribute 'UnknownError'

It looks like hvac.exceptions doesn't have an UnknownError object, but does have an UnexpectedError object.

@ianunruh
Copy link
Member

ianunruh commented Jul 2, 2015

Yep, that's what it should be throwing. Out of curiosity though, what HTTP error is being returned from Vault? That if/else should cover all documented HTTP errors from Vault.

@ianunruh ianunruh added the bug label Jul 2, 2015
@kgutwin
Copy link
Author

kgutwin commented Jul 2, 2015

Response code 403, errors is [u'bad token'].

@kgutwin
Copy link
Author

kgutwin commented Jul 2, 2015

FWIW, the version of Vault is very recent, as of yesterday (0.2.0 prerelease)

@ianunruh
Copy link
Member

ianunruh commented Jul 2, 2015

Thanks! As of today, their documentation does not document the use of 403 Forbidden. This should probably be raised on their issue tracker.

@kgutwin
Copy link
Author

kgutwin commented Jul 2, 2015

The change appeared in hashicorp/vault#366. I'll mention it there.

@ianunruh
Copy link
Member

ianunruh commented Jul 3, 2015

Fixed in 27b5b29

@ianunruh ianunruh closed this as completed Jul 3, 2015
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

2 participants