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

Task timed out after 5.01 seconds #48

Open
jamaroney opened this issue Sep 11, 2023 · 4 comments
Open

Task timed out after 5.01 seconds #48

jamaroney opened this issue Sep 11, 2023 · 4 comments

Comments

@jamaroney
Copy link

I run the HelpIntent test and the TestAllStates Test, and they both fail with the message "Task timed out after 5.01 seconds"

You state to "make sure you have set up the environment variables correctly" - I followed all previous steps under "Instructions", so I don't know what else to inspect.

@rjcohn
Copy link
Owner

rjcohn commented Sep 11, 2023

The problem in this case is at MyQ API level. I've been waiting for a fix from PyMyQ. One's been proposed in this PR, but the maintainer of HomeAsistant has suggested that the fix is incorrect and that the problem may be with the MyQ infrastructure. He wants to wait a few days to see if MyQ fixes the problem. In @hjdhjd's words:

I largely consider this issue closed until there’s a significant enough body of evidence (as in weeks, not a couple of days) of being completely unable to login or access the API. That’s just not the case…I appreciate folks rely on, and enjoy using, the solutions we’ve all created over the years, but sometimes the actual solve is: just give them a minute to fix it…I’m sure some developer/engineer on the myQ end of things is having a tough couple of days too.

If there is a fix in the library, I'll update the code here to use it.

In the meantime, I updated the README to provide a little more help when a test fails. I didn't intend for the HelpIntent to require authentication. It's on my list to change. Here's the log that shows the (unresolved) problem:

[DEBUG]	2023-09-11T13:21:36.988Z	9fa4c05b-6c0b-4acf-82af-ae9085099286	Sending myq api request https://partner-identity.myq-cloud.com/connect/authorize and headers {'redirect': 'follow', 'User-Agent': '76kpV'} with connection pooling
[DEBUG]	2023-09-11T13:21:37.087Z	9fa4c05b-6c0b-4acf-82af-ae9085099286	Attempt 1 request failed with exception : 403 - Forbidden
[DEBUG]	2023-09-11T13:21:37.087Z	9fa4c05b-6c0b-4acf-82af-ae9085099286	Request failed with "403 Forbidden" (attempt #1/5)"; trying again in 2 seconds
[DEBUG]	2023-09-11T13:21:39.089Z	9fa4c05b-6c0b-4acf-82af-ae9085099286	Sending myq api request https://partner-identity.myq-cloud.com/connect/authorize and headers {'redirect': 'follow', 'User-Agent': '76kpV'} with connection pooling
[DEBUG]	2023-09-11T13:21:39.104Z	9fa4c05b-6c0b-4acf-82af-ae9085099286	Attempt 2 request failed with exception : 403 - Forbidden
[DEBUG]	2023-09-11T13:21:39.105Z	9fa4c05b-6c0b-4acf-82af-ae9085099286	Request failed with "403 Forbidden" (attempt #2/5)"; trying again in 4 seconds
2023-09-11T13:21:41.713Z 9fa4c05b-6c0b-4acf-82af-ae9085099286 Task timed out after 5.01 seconds

Leaving this open until the API problem gets resolved.

@jamaroney
Copy link
Author

Thanks for the prompt response. We'll wait and see....

@hjdhjd
Copy link

hjdhjd commented Sep 11, 2023

For what it's worth...I've seen these issues largely be resolved as of the end of the weekend and I, myself, haven't had an issue since Saturday morning.

@rjcohn You might want to take a look at my code for how I've implemented an optional region designation as a workaround for these infrastructure challenges when they occur, but as I said elsewhere: I wouldn't permanently select a region and trust the load balancer to do the right thing (unless it's broken). The regions (east and west) are geographic but that doesn't necessarily correlate to what one person should pick (e.g. an east-coast person shouldn't necessarily pick east).

The logic I will be implementing in the future (I want a little distance from this event before making additional changes) is essentially:

  1. Try to connect to the general (load-balanced) API endpoint.
  2. If that fails, try one region.
  3. If that fails, try the other region.
  4. Repeat 1-3 until something works.

That should increase the robustness of this API for everyone down the line. I'll be releasing an update to do that in the next week or so, but I prefer to reduce the number of variables changing at once given the myQ infrastructure hiccups of the past few days.

@rjcohn
Copy link
Owner

rjcohn commented Sep 23, 2023

I've done some more testing (including updating to the current pymyq). The tests in test_lambda.py all succeed locally, while the AWS Lambda tests (and the actual skill) fail. The failure is in the initial auth call. I've tried running exactly a test_lambda.py test in AWS, and it fails. Then I tried running example.py, and it behaves the same -- succeeds locally, fails in AWS.
This makes me think that Chamberlain is blocking AWS IP addresses, though maybe there's something else that is different that I can't think of.
See arraylabs/pymyq#185.

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

3 participants