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

Invalid account credentials crashes homebridge #116

Open
tbaur opened this issue Sep 18, 2023 · 6 comments
Open

Invalid account credentials crashes homebridge #116

tbaur opened this issue Sep 18, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@tbaur
Copy link

tbaur commented Sep 18, 2023

Describe the bug
Alarm.com threw an error and the plugin crashed Homebridge entirely. Requires better error handling.

To Reproduce
[9/18/2023, 9:18:48 AM] Error: GET https://www.alarm.com/web/api/identities failed: GET https://www.alarm.com/web/api/identities failed: [object Object]
at /usr/local/lib/node_modules/homebridge-node-alarm-dot-com/node_modules/node-alarm-dot-com/dist/index.js:150:15
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at getIdentitiesState (/usr/local/lib/node_modules/homebridge-node-alarm-dot-com/node_modules/node-alarm-dot-com/dist/index.js:134:12)
at ADCPlatform.getAccountSettings (/usr/local/lib/node_modules/homebridge-node-alarm-dot-com/src/index.ts:378:24)
at ADCPlatform.refreshDevices (/usr/local/lib/node_modules/homebridge-node-alarm-dot-com/src/index.ts:392:5)
[9/18/2023, 9:18:48 AM] Got SIGTERM, shutting down Homebridge...

@tbaur tbaur added the bug Something isn't working label Sep 18, 2023
@chase9
Copy link
Member

chase9 commented Sep 20, 2023

Hi Tim,

Agreed, but what do you think the plugin should do when we encounter fatal errors? Do you think a red line warning in the log is enough?

Also, I'm guessing the error here is that login failed due to missing MFA but could you please confirm?

@tbaur
Copy link
Author

tbaur commented Sep 20, 2023

Yeah. It could fail gracefully -- handle the error, report on it and not crash homebridge :) Then retry. Other plugins do this. It just needs better error handling here.

Looks like a server side error, not related to config. The API seems to fail sometimes, crash homebridge, then they recover and everything continues on.

@tbaur
Copy link
Author

tbaur commented Sep 20, 2023

I'm not sure if this is applicable, something new the myQ plugin is doing to add even more failure handling...

[9/20/2023, 12:03:58 PM] [myQ] myQ API: Switched to myQ cloud region: west.

They have multiple API endpoints, east and west. The plugin sees a failure and switches the API endpoint used, continues on. In this case it has helped a lot, but it's also how myQ has built their infra. Bit of extra effort to keep the plugin rolling. Maybe alarm.com has different options.

@chase9
Copy link
Member

chase9 commented Oct 19, 2023

Just pushed up some code to the beta branch which will stop homebridge crashing the getAccountSettings() method fails.

@tbaur
Copy link
Author

tbaur commented Oct 19, 2023 via email

@chase9 chase9 changed the title Error on GET and plugin crashed Homebridge Invalid account credentials crashes homebridge Nov 12, 2023
@chase9
Copy link
Member

chase9 commented Nov 12, 2023

Fixed in b7736ea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants