home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.83k stars 30.91k forks source link

401 Unauthorized Error #102140

Closed alexbreezy92 closed 1 year ago

alexbreezy92 commented 1 year ago

The problem

Hello! I've been following the MyQ problems for multiple weeks now. I got working again with the useragent fix then tried removing Python-MyQ and PyMyQ and reinstalling. I deleted the folders about it in config when I jumped into my Home Assistant container. What was odd was when I did this I ended up not being able to resolve any web addresses. I had to recreate resolv.conf and provide a DNS to get things running again. Finally, I removed the image from the container and did a docker pull to start fresh. For the last couple of days I had a blank, and I mean blank, login wizard whenever I hopped into devices and typed in MyQ for integrations. It kept saying cannot_connect. Today, it logged in but I'm dealing with 403 then 401 errors. What line to I have to modify to resolve the broken path? I see the 42 in init.py but those arent usually code to modify. I'm fully up-to-date.

Log: Logger: pymyq.api Source: components/myq/init.py:42 First occurred: 8:19:36 PM (5 occurrences) Last logged: 8:21:35 PM

Authentication failed: Error requesting data from https://partner-identity.myq-cloud.com/connect/token: 401 - Unauthorized

What version of Home Assistant Core has the issue?

core-2023.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

MyQ

Link to integration documentation on our website

https://www.home-assistant.io/integrations/myq/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @ehendrix23, @lash-l, mind taking a look at this issue as it has been labeled with an integration (myq) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `myq` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign myq` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


myq documentation myq source (message by IssueLinks)

saxopwn commented 1 year ago

Yep, getting the 401 and 403 errors even after updating to 10.3

mikemrm commented 1 year ago

I was still on 10.0 and received the same error. Upgraded to 10.3 and issue continues.

alexbreezy92 commented 1 year ago

Tried again today. Still broken. It does, however, know when the password is incorrect so the path has to be right. I tried logging out of my phone MyQ app and noticed when I logged back in that there was a captcha. I wonder if we're failing those.

Lash-L commented 1 year ago

If you're still having issues, there is a 95% chance that you did manually added a fix and then did not remove it. I know for instance, one user had a fix that they shared that would automatically apply the fix everytime you rebooted - which is very problematic.

If you did any fix, I would recommend, removing anything myq related in your config folder, disabling the integration, run pip uninstall python-myq and pip uninstall pymyq in the terminal with protected mode off, restart, ensure that nothing myq is installed by calling pip show pymyq and then pip show python-myq. And then re-enable the integration

alexbreezy92 commented 1 year ago

Sure no problem, I can do that again and report back. Maybe it has something to do with protect mode. Would you mind elaborating on that a bit more? I typically use Portainer to hop into my container for Home Assistant but have also used Putty to do so. The last time I ran the Python package installer it uninstalled both of those successfully. Again, I’ll give it a go in the evening and report back if it worked or not since there’s more than one person on this thread.

Lash-L commented 1 year ago

Gotcha, portainer should be fine. I just know a lot of people were using the advance ssh addon in HA. With taht addon, you have to turn on protected mode to be able to get into the ha docker contianer

alexbreezy92 commented 1 year ago

Ah okay that explains the confusion on my part. Thanks for clearing that up. More to come.

saxopwn commented 1 year ago

If you're still having issues, there is a 95% chance that you did manually added a fix and then did not remove it. I know for instance, one user had a fix that they shared that would automatically apply the fix everytime you rebooted - which is very problematic.

If you did any fix, I would recommend, removing anything myq related in your config folder, disabling the integration, run pip uninstall python-myq and pip uninstall pymyq in the terminal with protected mode off, restart, ensure that nothing myq is installed by calling pip show pymyq and then pip show python-myq. And then re-enable the integration

D'oh, I did a fix... Followed these instructions (but deleted the integration instead) now I'm getting "Failed to connect" when I try to set it up again. Username and password are correct- even reset them in the app. No sign of myq in /config/ and the pip shows aren't yielding anything...

SeanathanVT commented 1 year ago

Also experiencing this. I did not perform any temporary fixes or workarounds. Just removed / reinstalled while troubleshooting and am receiving the "Failed to connect" error message as well.

Let me know if I can provide any additional information!

Lash-L commented 1 year ago

Wait an hour or two and let me know if you are still having problems

msandvold commented 1 year ago

Get this in my log: Config entry 'MyQ-Garasje' for myq integration not ready yet: Got 429 error - stopping request until 2023-10-18 19:37:32.393023. there were 1 request; Retrying in background

saxopwn commented 1 year ago

Wait an hour or two and let me know if you are still having problems

Still having problems

adamrgolf commented 1 year ago

I know this isn't too helpful, but I'm experience issues as well: "Failed to connect"

spotpkt commented 1 year ago

For a while, I was getting 403 and 401 errors. Just updated and am now getting the same 429 error that @msandvold is getting.

Logger: homeassistant.config_entries
Source: config_entries.py:441
First occurred: 1:31:37 PM (5 occurrences)
Last logged: 2:10:38 PM

Config entry  *****@****** for myq integration not ready yet: Got 429 error - stopping request until 2023-10-18 19:16:37.359666. there were 1 request; Retrying in background
Config entry  *****@****** for myq integration not ready yet: Got 429 error - stopping request until 2023-10-18 19:55:38.845345. there were 1 request; Retrying in background
Whaledad commented 1 year ago

OK, yesterday I did the whole "remove all traces of (py)MyQ", reboot, re-install and I was so happy: everything was working again. This morning at 10:34 AM CDT it turned "unavailable" again and a "reload" leads to "failed setup, will retry".

2023-10-18 16:24:39.307 DEBUG (MainThread) [pymyq.api] Performing initial authentication into MyQ 2023-10-18 16:24:39.308 DEBUG (MainThread) [pymyq.api] Scheduling token refresh, last refresh was None 2023-10-18 16:24:39.308 DEBUG (MainThread) [pymyq.api] Initiating OAuth authentication 2023-10-18 16:24:39.309 DEBUG (MainThread) [pymyq.api] Retrieving authentication page 2023-10-18 16:24:39.309 DEBUG (MainThread) [pymyq.request] Sending myq api request https://partner-identity.myq-cloud.com/connect/authorize and headers {'redirect': 'follow'} with connection pooling 2023-10-18 16:24:39.441 DEBUG (MainThread) [pymyq.request] Attempt 1 request failed with exception : 429 - Too Many Requests 2023-10-18 16:24:39.441 DEBUG (MainThread) [pymyq.request] Too many request have been made - putting a temporary pause on sending any requests for 45 minutes

DT00689 commented 1 year ago

Same issue as Whaledad

2023-10-18 16:37:05.071 DEBUG (MainThread) [pymyq.api] Performing initial authentication into MyQ 2023-10-18 16:37:05.071 DEBUG (MainThread) [pymyq.api] Scheduling token refresh, last refresh was None 2023-10-18 16:37:05.071 DEBUG (MainThread) [pymyq.api] Initiating OAuth authentication 2023-10-18 16:37:05.072 DEBUG (MainThread) [pymyq.api] Retrieving authentication page 2023-10-18 16:37:05.072 DEBUG (MainThread) [pymyq.request] Sending myq api request https://partner-identity.myq-cloud.com/connect/authorize and headers {'redirect': 'follow'} with connection pooling 2023-10-18 16:37:05.120 DEBUG (MainThread) [pymyq.request] Attempt 1 request failed with exception : 429 - Too Many Requests 2023-10-18 16:37:05.120 DEBUG (MainThread) [pymyq.request] Too many request have been made - putting a temporary pause on sending any requests for 45 minutes 2023-10-18 16:37:05.121 WARNING (MainThread) [homeassistant.config_entries] Config entry 'myemail' for myq integration not ready yet: Got 429 error - stopping request until 2023-10-18 22:22:05.120972. there were 1 request; Retrying in background

digitalwolf1208 commented 1 year ago

As an FYI, after the issues started showing up a couple of weeks ago, I switched to an alternate method of connecting, setting up a Homebridge docker container and connecting through that. It was working just fine until yesterday, when it too started seeing the 429 - Too Many Requests response. I don't know if it's an API issue, or if they are just completely shutting off access from anyone other than their own app. I've waited up to 3 hours between making attempts, and it always gets the 429 response. I'd love to go back to using the MyQ integration instead of the Homebridge workaround, but since neither are working, I'm worried that neither may be available going forward.

alexbreezy92 commented 1 year ago

If you're still having issues, there is a 95% chance that you did manually added a fix and then did not remove it. I know for instance, one user had a fix that they shared that would automatically apply the fix everytime you rebooted - which is very problematic.

If you did any fix, I would recommend, removing anything myq related in your config folder, disabling the integration, run pip uninstall python-myq and pip uninstall pymyq in the terminal with protected mode off, restart, ensure that nothing myq is installed by calling pip show pymyq and then pip show python-myq. And then re-enable the integration

Now that I'm back home I tried this out. The integration continually does, "Fail setup, will retry". Unfortunately that's not the fix. Any other ideas?

ur7x commented 1 year ago

Mine went off line about 9 hours ago. back to being broken.. Why does liftmaster hate us all?

homeontherocks commented 1 year ago

Mine also went offline a few hours ago and errors out with 429 error.

SN0WTR00PER commented 1 year ago

@ur7x I have bought all the parts to do a MYQ kill setup..... I will no longer depend of their FKG cloud. I hate Liftmaster so bad.

just370z commented 1 year ago

I am also getting the failed setup and the 429 error. I did do the fix a couple weeks ago but I removed it, i think. If anyone gets around this, comment below TIA

Config entry 'XXX' for myq integration not ready yet: Got 429 error - stopping request until 2023-10-19 03:37:33.966922. there were 1 request; Retrying in background

jordangelep commented 1 year ago

@ur7x I have bought all the parts to do a MYQ kill setup..... I will no longer depend of their FKG cloud. I hate Liftmaster so bad.

@SN0WTR00PER

What is the setup needed to not have to rely on MyQ cloud and avoid the constant errors lately?

TonyMontuna commented 1 year ago

Getting all the same issues as listed above.

A month ago or so when this all started, I did the pymy fix. I then removed it last week when it went down again, everything was working. Until yesterday, all went unavailable again.

I left it alone, and a few hours later, they all came back online.

Only to wake up this morning to them being unavailable again.

Same error, when trying to reconnect I get a "failed to setup" -Here are my logs:


`Logger: homeassistant.components.myq
Source: helpers/update_coordinator.py:322
Integration: MyQ (documentation, issues)
First occurred: October 17, 2023 at 4:15:55 PM (5 occurrences)
Last logged: 7:06:05 AM

Error fetching myq devices data: Error requesting data from https://devices.myq-cloud.com/api/v6.0/Accounts/73a8febb-c116-4003-9a61-a0800b5443a0/Devices: Cannot connect to host devices.myq-cloud.com:443 ssl:default [Try again]
Error fetching myq devices data: Got 429 error - stopping request until 2023-10-18 16:27:54.684647. there were 9606 request
Error fetching myq devices data: Got 429 error - stopping request until 2023-10-19 04:42:05.071330. there were 66 request
Error fetching myq devices data: Got 429 error - stopping request until 2023-10-19 09:02:35.071852. there were 137 request
Error fetching myq devices data: Got 429 error - stopping request until 2023-10-19 11:51:05.059692. there were 206 request`

I am extremely resistant to the idea of putting a ratgo board on my machine considering this should work.

Is there a plan to mitigate these future issues? It seems like every couple days we all get disconnected from Myq and it break our integration.

SN0WTR00PER commented 1 year ago

@jordangelep Take a look at this. https://digiblur.com/wiki/ha/esphome-garage-opener/ I'm planning to install this setup in the next month.

rgnet5 commented 1 year ago

MyQ is definitely throttling their API. Getting the same 429 error (too many requests) on HomeBridge

halfskye commented 1 year ago

MyQ is definitely throttling their API. Getting the same 429 error (too many requests) on HomeBridge

I'm getting the same rate limiting 429 error and am not using Homekit/Homebridge - just straight MyQ integration:

Logger: homeassistant.config_entries
Source: config_entries.py:441
First occurred: 8:46:26 AM (1 occurrences)
Last logged: 8:46:26 AM

Config entry 'not.real@gmail.com' for myq integration not ready yet: Got 429 error - stopping request until 2023-10-19 14:31:26.591608. there were 1 request; Retrying in background
MichaelRPowell commented 1 year ago

Is there a plan to mitigate these future issues? It seems like every couple days we all get disconnected from Myq and it break our integration.

I feel the people working on this have done everything they can. It seems clear at this point that there are only one of two explanations.

The first explanation is that MyQ is purposely killing these third party options. That would make sense, because they charge monthly fees to enable their service in some car brands. They probably see this as a way to push customers to their monthly paid service, when really the cost to them should be absolutely minimal and there shouldn't need to be a reason for that (other than profit/greed). Their mistake was probably having so many of these devices marked down for Prime Day(s) to boost their customer base, now that they made little or no profit off the device, they have to charge through the service.

The second explanation, which would be worse, is that they have their teams modifying the in production API daily not realizing everything they're breaking down the line. Based on responses here, they're killing interest in the devices moving forward and forcing people to look at alternatives immediately. I know myself and many others won't recommend MyQ in the future to anyone at this rate. If this is the reason it seems like a very destructive thing to do to your customer base. Without an official message going out I kind of want to believe it is accidental.

I think this integration is on the same path as the Mazda integration. Companies want to milk us, that means making everything a monthly service. :(

Has anyone been in contact with MyQ for an official word? If we know they want to kill this, then it is time for me to move on like others have. Additionally, thank you to everyone that has been maintaining this integration in the meantime and playing the cat and mouse game with MyQ.

Lash-L commented 1 year ago

The first explanation is that MyQ is purposely killing these third party options.

That is what is happening yes - some users have gotten support to confirm as much.

They probably see this as a way to push customers to their monthly paid service

That is part of it - they also advertise their other products through the myq app, if you don't use their pap, you aren't seeing their ads.

I am not sure if their crackdown started with negative intentions or not. There is a high likelihood that they were just having server issues and after doing some research found that so many people were using the api through third party means and wanted to crack down on it

Has anyone been in contact with MyQ for an official word? If we know they want to kill this, then it is time for me to move on like others have

I have attempted, I've been in contact with one employee who has told me a few times over the past few weeks that someone would be in contact "soon" but I have gotten no word or further information

TonyMontuna commented 1 year ago

The first explanation is that MyQ is purposely killing these third party options.

That is what is happening yes - some users have gotten support to confirm as much.

They probably see this as a way to push customers to their monthly paid service

That is part of it - they also advertise their other products through the myq app, if you don't use their pap, you aren't seeing their ads.

I am not sure if their crackdown started with negative intentions or not. There is a high likelihood that they were just having server issues and after doing some research found that so many people were using the api through third party means and wanted to crack down on it

Has anyone been in contact with MyQ for an official word? If we know they want to kill this, then it is time for me to move on like others have

I have attempted, I've been in contact with one employee who has told me a few times over the past few weeks that someone would be in contact "soon" but I have gotten no word or further information

I am seeking community assistance in drafting a letter to the CEO and get as much of a reliable answer as possible.

Your input would be appreciated

Reddit:

https://www.reddit.com/r/homeassistant/s/uAf8RBbWPZ

HA Community:

https://community.home-assistant.io/t/crafting-a-letter-to-chamberlain-group-ceo-for-myq-issues/628692?u=harsh_tone

msandvold commented 1 year ago

Hi @TonyMontuna i use this integration for 3 reasons.

  1. One app/system to rule them all -> HA <3
  2. Several simle automations based on the status of the gate. Like -> Close if no one is at home. Turn on light in garage my astro is "on". Start/stop AC in garage (saves power/electricity).
  3. Open/Close from phone (widget button on phones)

Norwegian user.

msandvold commented 1 year ago

BTW, Seems like the MYQ is online again? Edit: lasted for 6 minutes...

ratsputin commented 1 year ago

Same problem as well. Disabling MyQ for an hour or two then reenabling it fixes it for a while.

Checking the debug logs, I count 128 of the following

DEBUG (MainThread) [pymyq.request]     Response Code: 200

before it fails again.

I'm doing another test to see if the count is consistent.

cleverdevil commented 1 year ago

The last month or so has been infuriating with Chamberlain clearly trying to prevent integrations that they don’t want to see. I’m over it. Still getting 429 or 403 errors constantly.

I just ordered a Meross Smart Garage Remote and the adapter for Liftmaster from Amazon. Fifty bucks and I’ll never have to worry about this again.

hitnrun30 commented 1 year ago

I believe this has been said not can't there be a way to make the myq integration without connecting to the Internet. Isn't that one of the major points of HA?

jordangelep commented 1 year ago

@SN0WTR00PER Take a look at this. https://digiblur.com/wiki/ha/esphome-garage-opener/ I'm planning to install this setup in the next month.

Oh my, that looks something I could screw up nicely lol

alexbreezy92 commented 1 year ago

My issue has magically resolved itself for now. Closing this topic. Feel free to make your own.

alexbreezy92 commented 1 year ago

My issue has magically resolved itself for now. Closing this topic. Feel free to make your own.

SeanathanVT commented 1 year ago

You'll be back.

ratsputin commented 1 year ago

I believe this has been said not can't there be a way to make the myq integration without connecting to the Internet. Isn't that one of the major points of HA?

I'm currently looking into this. There's a github project that will speak Security+ 2.0 (what MyQ is based on) using a software defined radio. Theoretically, HA could communicate directly with MyQ devices without any cloud interaction.

hitnrun30 commented 1 year ago

I believe this has been said not can't there be a way to make the myq integration without connecting to the Internet. Isn't that one of the major points of HA?

I'm currently looking into this. There's a github project that will speak Security+ 2.0 (what MyQ is based on) using a software defined radio. Theoretically, HA could communicate directly with MyQ devices without any cloud interaction.

I would love to help if I could. Can't MQTT be used?

ratsputin commented 1 year ago

I believe this has been said not can't there be a way to make the myq integration without connecting to the Internet. Isn't that one of the major points of HA?

I'm currently looking into this. There's a github project that will speak Security+ 2.0 (what MyQ is based on) using a software defined radio. Theoretically, HA could communicate directly with MyQ devices without any cloud interaction.

I would love to help if I could. Can't MQTT be used?

Unfortunately, no. Basically, the Software Defined Radio will be emulating a smart remote. It's a USB dongle.

Keep in mind, this is all theoretical at this point. I'm awaiting an inexpensive SDR right now for testing.

hitnrun30 commented 1 year ago

You know what else is weird. I have been using the Node Red MyQ Device Node and just querying every 3 seconds for a while and no issue. What is it doing that the pymyq is messing up? They use the same backend if I'm correct?

Neu-Bob commented 1 year ago

You know what else is weird. I have been using the Node Red MyQ Device Node and just querying every 3 seconds for a while and no issue. What is it doing that the pymyq is messing up? They use the same backend if I'm correct?

Is it still working for you? Mine stopped working a while ago...

hitnrun30 commented 1 year ago

You know what else is weird. I have been using the Node Red MyQ Device Node and just querying every 3 seconds for a while and no issue. What is it doing that the pymyq is messing up? They use the same backend if I'm correct?

Is it still working for you? Mine stopped working a while ago...

still going strong. I am going to watch it through the weekend and if it is good I am going to make a node red integration.

hitnrun30 commented 1 year ago

Ah finally got a too many requests, does anyone know what the limit is?