Rackspace provider not getting token from the identity API
See original GitHub issueUpdate: solved! See my comment below.
I’m just starting out with lexicon and trying to get it working with Rackspace Cloud DNS. Requests are failing with a requests.exceptions.HTTPError: 401 Client Error: Resource not found for validate token request
error. With debugging on, it appears lexicon is not requesting a token from https://identity.api.rackspacecloud.com/v2.0/tokens
before it continues to submit a reqeuset to https://dns.api.rackspacecloud.com/v1.0/…
.
Here’s the command I’m running:
lexicon rackspace --log_level DEBUG --auth-username myusername --auth-api-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX list example.com A
And here’s the output:
Arguments: Namespace(action='list', auth_account=None, auth_api_key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', auth_token=None, auth_username='myusername', content=None, delegated=None, domain='example.com', identifier=None, log_level='DEBUG', name=None, output='TABLE', priority=None, provider_name='rackspace', sleep_time=1, ttl=None, type='A')
Starting new HTTPS connection (1): dns.api.rackspacecloud.com:443
https://dns.api.rackspacecloud.com:443 "GET /v1.0/None/domains?name=example.com HTTP/1.1" 401 0
Traceback (most recent call last):
File "/Users/q/src/dns-lexicon/env/bin/lexicon", line 10, in <module>
sys.exit(main())
File "/Users/q/src/dns-lexicon/env/lib/python3.7/site-packages/lexicon/cli.py", line 117, in main
results = client.execute()
File "/Users/q/src/dns-lexicon/env/lib/python3.7/site-packages/lexicon/client.py", line 64, in execute
self.provider.authenticate()
File "/Users/q/src/dns-lexicon/env/lib/python3.7/site-packages/lexicon/providers/base.py", line 69, in authenticate
return self._authenticate()
File "/Users/q/src/dns-lexicon/env/lib/python3.7/site-packages/lexicon/providers/rackspace.py", line 66, in _authenticate
'name': self.domain
File "/Users/q/src/dns-lexicon/env/lib/python3.7/site-packages/lexicon/providers/base.py", line 142, in _get
return self._request('GET', url, query_params=query_params)
File "/Users/q/src/dns-lexicon/env/lib/python3.7/site-packages/lexicon/providers/rackspace.py", line 190, in _request
response.raise_for_status()
File "/Users/q/src/dns-lexicon/env/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Resource not found for validate token request for url: https://dns.api.rackspacecloud.com/v1.0/None/domains?name=example.com
Of course, this request will fail if is no token has been received from the identity.api.rackspacecloud.com
API endpoint.
I’m happy to help troubleshoot, but I thought I’d ask first if I’m using the correct parameters for the rackspace provider.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
I submitted a pull request. With this change, I can do
and don’t need to specify any tenant/account ID. Thanks for the nudge @quinncomendant 👍
This looks great. Thanks @rmarscher