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

Authorization fails when called from AWS #185

Open
rjcohn opened this issue Sep 24, 2023 · 1 comment
Open

Authorization fails when called from AWS #185

rjcohn opened this issue Sep 24, 2023 · 1 comment

Comments

@rjcohn
Copy link

rjcohn commented Sep 24, 2023

This is similar to other reported errors, but I now have an issue that is more consistent and easier to reproduce (if you have an AWS account). If you add valid credentials to example.py, it consistently runs successfully locally (e.g. on my Mac). The same code running on an EC2 server in AWS consistently fails -- the initial auth call to https://partner-identity.myq-cloud.com/connect/authorize fails, returning a 403.
I ran into this starting a few weeks ago when my MyQ Alexa skill stopped working (the same time other issues were reported here).

@eliasisrael
Copy link

The bug is on line 124 of request. py.

the 429 status returns a header named "retry-after". That field specifies the number of seconds the Client must wait before trying again. Instead, the code on line 124 tries to do exponential back-off, but it starts from a very small value.

If you look at the error header, you will see the server is asking for a wait time of 1750 Seconds or more.

See this link:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After

This explains why shutting down the module and waiting seems to fix the problem. And it explains why the problem is intermittent: it is happening on the Oauth auth cycle, which is somewhat infrequent.

The stuff about user agent strings is a red herring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants