lexicon icon indicating copy to clipboard operation
lexicon copied to clipboard

Hover fails with "HTTPError: 400 Client Error: Bad Request for url"

Open subtractum opened this issue 3 years ago • 3 comments

Example command line with sensitive info replaced by "XXXXX":

lexicon hover --log_level DEBUG --auth-username "XXXXX" --auth-password "XXXXX" list XXXXX TXT

...outputs this:

Arguments: Namespace(delegated=None, config_dir='/root', provider_name='hover', action='list', domain='XXXXX', type='TXT', name=None, content=None, ttl=None, priority=None, identifier=None, log_level='DEBUG', output='TABLE', auth_username='XXXXX', auth_password='XXXXX') Starting new HTTPS connection (1): www.hover.com:443 https://www.hover.com:443 "GET /signin HTTP/1.1" 200 3653 Starting new HTTPS connection (1): www.hover.com:443 https://www.hover.com:443 "POST /signin/auth.json HTTP/1.1" 400 None Traceback (most recent call last): File "/usr/lib/python-exec/python3.9/lexicon", line 33, in sys.exit(load_entry_point('dns-lexicon==3.3.4', 'console_scripts', 'lexicon')()) File "/usr/lib/python3.9/site-packages/lexicon/cli.py", line 117, in main results = client.execute() File "/usr/lib/python3.9/site-packages/lexicon/client.py", line 71, in execute self.provider.authenticate() File "/usr/lib/python3.9/site-packages/lexicon/providers/base.py", line 69, in authenticate return self._authenticate() File "/usr/lib/python3.9/site-packages/lexicon/providers/hover.py", line 42, in _authenticate response.raise_for_status() File "/usr/lib/python3.9/site-packages/requests/models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.hover.com/signin/auth.json

Credentials provided confirmed to be working elsewhere. (e.g., works fine with this tool: https://github.com/dschanoeh/hover-ddns )

subtractum avatar Jul 26 '21 21:07 subtractum

Amazing timing on this bug report. I just discovered lexicon today and was playing around with it, and ran into the same problem. Wasn't entirely sure I wasn't just doing something wrong since I've never had it working.

I noticed that if I enter a fake username I get this: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://www.hover.com/signin/auth.json

But if I enter a real username, I get this regardless of whether the password is correct or not: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.hover.com/signin/auth.json

Hope this is something that's easy to resolve. lexicon looks like a great project, would love to start using it.

nitro322 avatar Jul 27 '21 00:07 nitro322

I guess something has changed in the API that makes it incompatible now. Sadly I do not have an account on Hover, so either one of you can propose a PR to fix the provider, or you should lend me some valid credentials temporarily so I can fix the issue directly.

adferrand avatar Aug 09 '21 17:08 adferrand

The Hover module definitely has some issues, but it's not completely broken. Per the CODEOWNERS file, @bkanuka is the maintainer. Can you help out? (I also use Hover so can test when changes come thru)

WhimsicalLlamaH avatar Mar 22 '22 23:03 WhimsicalLlamaH