hjdhjd / homebridge-myq

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

TypeError: Cannot read properties of undefined (reading 'length') after changing password #1087

Closed Danimal4326 closed 1 year ago

Danimal4326 commented 1 year ago

Describe The Problem: Issues logging into myQ. First was having issues saying my password was incorrect. Verified in app, and it worked. Changed password, and now getting the error listed below

To Reproduce: re-start the child bridge with new password in config

Logs:

TypeError: Cannot read properties of undefined (reading 'length')
    at myQApi.oauthLogin (file:///usr/lib/node_modules/homebridge-myq/node_modules/@hjdhjd/myq/src/myq-api.ts:190:44)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at myQApi.getOAuthToken (file:///usr/lib/node_modules/homebridge-myq/node_modules/@hjdhjd/myq/src/myq-api.ts:239:16)
    at myQApi.acquireAccessToken (file:///usr/lib/node_modules/homebridge-myq/node_modules/@hjdhjd/myq/src/myq-api.ts:367:19)
    at myQApi.refreshAccessToken (file:///usr/lib/node_modules/homebridge-myq/node_modules/@hjdhjd/myq/src/myq-api.ts:413:14)
    at myQApi.refreshDevices (file:///usr/lib/node_modules/homebridge-myq/node_modules/@hjdhjd/myq/src/myq-api.ts:455:10)
    at myQPlatform.updateAccessories (file:///usr/lib/node_modules/homebridge-myq/src/myq-platform.ts:295:10)
    at file:///usr/lib/node_modules/homebridge-myq/src/myq-platform.ts:337:14

Homebridge Configuration:

        {
            "email": "xxxs@xxx",
            "password": "xxx",
            "name": "Garage",
            "myQRegion": "west",
            "refreshInterval": 10,
            "activeRefreshInterval": 2,
            "activeRefreshDuration": 250,
            "debug": true,
            "_bridge": {
                "username": "0E:51:7C:A7:34:0D",
                "port": 56166
            },
            "platform": "myQ"
        }

Environment:

Danimal4326 commented 1 year ago

Ok, looks like the above error was from my account being locked out.

Now I just keep getting:

[8/3/2023, 9:27:19 PM] [Garage] myQ API: Invalid myQ credentials given. Check your login and password.
[8/3/2023, 9:27:19 PM] [Garage] myQ API: Unable to acquire an OAuth access token.

I've verified I have the correct password, and even changed to a new one. The above message is all I keep getting.

Danimal4326 commented 1 year ago

Ok, just switched from 'west' to 'east' servers, and now it seems to work. Very strange. Seems like they have something going on in the back-end

hjdhjd commented 1 year ago

Thanks for the report. As I’ve said innumerable times, including in the documentation and the README: API errors will absolutely happen. Also: do not use region-specific options unless you absolutely need to and cannot get things working any other way. The myQ API is notoriously flaky. 😄

I’ll ensure the broader library is a bit more robust in the future to eliminate outright crashes like the above, so thanks for calling my attention to it. Best of luck!

Danimal4326 commented 1 year ago

I was using the 'west' region specifically because I kept getting timeout errors if I didn't specify anything. I changed to 'east' in my debugging, and it seems to work for now, so I'll leave it.

github-actions[bot] commented 1 year ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.