ptz0n / homebridge-verisure

 Platform plugin for Homebridge allowing to manage and control Verisure devices.
https://www.npmjs.com/package/homebridge-verisure
MIT License
66 stars 15 forks source link

Verisure broke token generation #127

Closed C-HGP closed 3 years ago

C-HGP commented 3 years ago

Hi!

Today I got this after the verisure webpage was down. Could it be something changed? I can't seem to get it working again.

[07/10/2021, 21:44:18] [verisure] Initializing verisure platform...
(node:2461) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined
    at /usr/local/lib/node_modules/homebridge-verisure/lib/platform.js:101:42
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2461) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:2461) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
ptz0n commented 3 years ago

The error message could be better. Did you try restarting the service?

C-HGP commented 3 years ago

The error message could be better. Did you try restarting the service?

Yes, i've restarted everything, i've tried reinstalling the plugin several times, even having a config without any data and the error pops up on boot of the plugin. I've tried reinstalling homebridge and different versions of homebridge aswell as this plugin. I have also tried reinstalling a fresh copy of rasbian to the pi and then installing homebridge via npm to be sure that it wasnt a distro error. Still get the exact same problem.

That is sadly the only error message I get.

C-HGP commented 3 years ago

Here is the full terminal log:

Initializing HAP-NodeJS v0.9.4...
[08/10/2021, 08:12:04] Loaded config.json with 0 accessories and 2 platforms.
[08/10/2021, 08:12:05] Loaded 0 cached accessories from cachedAccessories.
[08/10/2021, 08:12:05] ---
[08/10/2021, 08:12:06] Loaded plugin: homebridge-config-ui-x@4.41.2
[08/10/2021, 08:12:06] Registering platform 'homebridge-config-ui-x.config'
[08/10/2021, 08:12:06] ---
[08/10/2021, 08:12:06] Loaded plugin: homebridge-verisure@1.14.0
[08/10/2021, 08:12:06] Registering platform 'homebridge-verisure.verisure'
[08/10/2021, 08:12:06] ---
[08/10/2021, 08:12:06] Loading 2 platforms...
[08/10/2021, 08:12:06] [Config] Initializing config platform...
[08/10/2021, 08:12:06] [Config] Spawning homebridge-config-ui-x with PID 9835
[08/10/2021, 08:12:06] [verisure] Initializing verisure platform...
(node:9811) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9811) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:9811) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[08/10/2021, 08:12:14] [Homebridge UI] Homebridge Config UI X v4.41.2 is listening on :: port 8581
[08/10/2021, 08:12:15] [Homebridge UI] Error: listen EADDRINUSE: address already in use :::8581
[08/10/2021, 08:12:15] [Homebridge UI] Another process or service on this host is using port 8581.
[08/10/2021, 08:12:15] [Homebridge UI] Please stop the other service or change the port you have assigned to homebridge-config-ui-x.
[08/10/2021, 08:12:15] [Homebridge UI] Ending process now.
[08/10/2021, 08:12:15] Got SIGTERM, shutting down Homebridge...
C-HGP commented 3 years ago

Okay so yesterday the Verisure app and webpage was down for like 30min, this was because "Homey" users got spammed with texts, so Verisure rolled out a patch which fixed this, this was related to 2step authentication. The homebridge worked fine before the website was down, and when it came back up, it didn't work. My guess is that this plugin isn't working because of this.

ptz0n commented 3 years ago
Lanjelin commented 3 years ago

Been trying since yesterday evening to get this working. Fresh install, never tried the plugin before.

With and without MFA enabled. Installed both from Homebridge plugins, and from shell. Docker (don't see it should matter). Norway.

Guess Verisure has done something, as it throws 403?

Logs generally throw out the following:

[10/8/2021, 7:28:00 AM] [zigbee2mqtt] Using Zigbee2MQTT v1.21.2 (identified via zigbee2mqtt/bridge/info)
(node:2487) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/homebridge/node_modules/homebridge-verisure/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/homebridge/node_modules/homebridge-verisure/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/homebridge/node_modules/homebridge-verisure/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2487) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:2487) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[10/8/2021, 7:28:19 AM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info.
wakeUntilAPIReady: try 10

Running npx verisure lets me put in username and password, then spits out

(node:2716) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/homebridge/node_modules/homebridge-verisure/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/homebridge/node_modules/homebridge-verisure/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/homebridge/node_modules/homebridge-verisure/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2716) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:2716) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
C-HGP commented 3 years ago
  • Do you have the MFA enabled?
  • Maybe the token have expired?
  • In which country is your installation located?

It's not enabled, and if I try to have it enabled, and run npx verisure I get the exact same error. It's located in Sweden.

C-HGP commented 3 years ago

As I said, Verisure HAS rolled out a patch to the web and application because of an error where users who had Homey got spammed via SMS. I am positive that this is a probable cause of this error.

ptz0n commented 3 years ago

Okej, I'm not using Homey but I do use MFA. No issues with my setup. Let's focus on getting MFA working.

utezduyar commented 3 years ago

I have also started getting 403 errors. Things stopped working this morning. The plugin doesn't load and the entire homebridge is not starting.

I do not have MFA, I have a dedicated user for homebridge without MFA.

utezduyar commented 3 years ago
(node:568) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:568) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:568) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Lanjelin commented 3 years ago

As I said, Verisure HAS rolled out a patch to the web and application because of an error where users who had Homey got spammed via SMS. I am positive that this is a probable cause of this error.

Checked on my Homey, and the Verisure app is suddenly not working (it did some time earlier this week, I know for sure). Haven't gotten any SMS though.

C-HGP commented 3 years ago

As I said, Verisure HAS rolled out a patch to the web and application because of an error where users who had Homey got spammed via SMS. I am positive that this is a probable cause of this error.

Checked on my Homey, and the Verisure app is suddenly not working (it did some time earlier this week, I know for sure). Haven't gotten any SMS though.

I think the Homey-Verisure plugin rolled out a patch yesterday after this change, so if you update your Homey-verisure plugin, it should work. I am, however dependent on homebridge as I don't have a Homey.

ptz0n commented 3 years ago

Verified: This is affecting users without MFA. Tokens have not been expired.

utezduyar commented 3 years ago

I think there is something not right on verisure side but I am not sure. I cannot even get a token

/var/lib/homebridge/backups $ npx verisure
✔ What is your login email? · xxxxxx
✔ What is your password? · ********************
(node:811) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/lib/node_modules/homebridge-verisure/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:811) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:811) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
utezduyar commented 3 years ago

Is there a workaround you can suggest? Otherwise, I have to disable the plugin since it affects entire homebridge startup.

ptz0n commented 3 years ago

Seems that Verisure have updated the hostnames for authentication: m-api01.verisure.com

utezduyar commented 3 years ago

How can I reflect the change though? Will you be able to issue a new version of the plugin? Should I change the DNS entry on my machine (what is the previous authentication endpoint).

ptz0n commented 3 years ago

We need to update the verisure module, then bump the plugin version to trigger an update. See: https://github.com/ptz0n/node-verisure/pull/47

ptz0n commented 3 years ago

New version of the plugin available. Please update to v1.14.1.

C-HGP commented 3 years ago

Works like a charm, jag skickar en kaffe! :)

utezduyar commented 3 years ago

Thank you! It worked great.

utezduyar commented 3 years ago

I can also send coffe! Send me your swish if you wish.

ptz0n commented 3 years ago

Accept Swish for ☕️ and/or 🍺 at: +46730213072

Thanks for using the plugin and please continue to report ideas, issues and problems. You rock!