hjdhjd / homebridge-myq

:car: myQ Liftmaster and Chamberlain Plugin for Homebridge https://github.com/nfarina/homebridge
Other
570 stars 44 forks source link

MyQ API Error #1134

Closed ghosilyk closed 1 year ago

ghosilyk commented 1 year ago

Describe The Problem: Since the iOS latest update this plugin stopped working. It shows the following error:

myQ API error: Temporary myQ API server-side issues encountered: 429 - Too Many Requests. This typically indicates a myQ API lockout for a 60-90 minute period before resuming API connectivity.

To Reproduce:

Logs:

[10/19/2023, 9:15:53 PM] [MyQ] myQ API error: Temporary myQ API server-side issues encountered: 429 - Too Many Requests. This typically indicates a myQ API lockout for a 60-90 minute period before resuming API connectivity.

Homebridge Configuration:


Config is standard, only info in there is my username and password.

Screenshots:

Environment:

Heralds01 commented 1 year ago

I just restored back to v3.4.1 and it is doing it there also. Thanks for logging, I was about to 👍

spidercensus commented 1 year ago

+1 I am experiencing the same issue on homebridge-myq v3.4.3

My log shows:

[10/19/2023, 10:52:13 PM] [myQ] myQ API: Unable to access the OAuth authorization endpoint.
[10/19/2023, 10:54:14 PM] [myQ] myQ API: https://partner-identity.myq-cloud.com/connect/authorize?client_id=IOS_CGI_MYQ&code_challenge=(redacted)&code_challenge_method=S256&redirect_uri=com.myqops%3A%2F%2Fios&response_type=code&scope=MyQ_Residential+offline_access Error: 429 

I notice that when I manually curl the URL above, I get sent through a cloudflare portal. I wonder if they've (MyQ) been getting DDoS'd and have implemented some rate-limiting security on their side.

spidercensus commented 1 year ago

I notice retries are happening every 3 seconds on my instance.

[10/19/2023, 10:57:49 PM] [myQ] myQ API error: Temporary myQ API server-side issues encountered: 429 - Too Many Requests. This typically indicates a myQ API lockout for a 60-90 minute period before resuming API connectivity.
[10/19/2023, 10:57:50 PM] [myQ] myQ API error: Temporary myQ API server-side issues encountered: 429 - Too Many Requests. This typically indicates a myQ API lockout for a 60-90 minute period before resuming API connectivity.
[10/19/2023, 10:57:53 PM] [myQ] myQ API error: Temporary myQ API server-side issues encountered: 429 - Too Many Requests. This typically indicates a myQ API lockout for a 60-90 minute period before resuming API connectivity.

We may have a thundering herd issue wherein all the homebridge clients using MyQ are retrying and retrying without backing off, which could cause the API to rate-limit our client. Let's try implementing a random backoff timer for auth.

Edit: Actually this retry appears to be inside of the underlying library: https://github.com/hjdhjd/myq/blob/99e39834767eff53c933bfdd19b4c31af4714de7/src/myq-api.ts#L909

This might be a little tricky because auth is implemented as a Promise and the retry can't be turned off. A change would have to be made upstream hjdhjd/myq.

To be honest, any retries wrapping a finicky API like MyQ's really should have exponential backoff.

@hjdhjd is this a feature you'd sign off on if I wrote it? I don't mind contributing.

NathanBlais commented 1 year ago

This is a copy of issue 1128 a lot of people are having this problem (including me) but the host has stated he is not interested in a fix as stated here.

myQ pulling some shenanigans no doubt. I can't speak for the guy but this will likely be closed soon.

sapireli commented 1 year ago

I believe he is actively working on a solution. This situation is constantly changing, and it's important to remember that he has a life beyond just working on the HomeKit garage door plugin. Someone mentioned that the problem might be related to Cloudflare's anti-bot measures. I genuinely empathize with him because he's receiving a lot of pressure. A few days ago, it appeared that the issue had been resolved, but unfortunately, it has resurfaced. It's worth noting that some users who haven't restarted Homebridge or needed to re-authenticate haven't experienced the issue when these reports were made and hence per his statement - at that time (3 days ago) there was nothing to fix.