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

This plugin is taking long time to load and preventing Homebridge from starting #120

Closed utezduyar closed 3 years ago

utezduyar commented 3 years ago

I am not sure who is not handling ENETUNREACH but once it happens, homebridge doesn't start anymore due to verisure plugin. I have pages long logs about "this plugin is taking long time...".

Is this something you are familiar?

[5/5/2021, 4:48:30 PM] [verisure] info Entrance Door: Getting current sensor state. [5/5/2021, 4:48:30 PM] [verisure] info Bedroom Door: Getting current sensor state. [5/5/2021, 4:48:30 PM] [verisure] info Laundry Room Door: Getting current sensor state. [5/5/2021, 4:48:30 PM] [verisure] info Living Room Door: Getting current sensor state. [5/5/2021, 4:48:55 PM] Error: send ENETUNREACH 224.0.0.251:5353 at doSend (dgram.js:692:16) at defaultTriggerAsyncIdScope (internal/async_hooks.js:430:12) at afterDns (dgram.js:638:5) at processTicksAndRejections (internal/process/task_queues.js:81:21) [5/5/2021, 4:48:55 PM] Got SIGTERM, shutting down Homebridge... [5/5/2021, 4:49:00 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [5/5/2021, 4:49:05 PM] [HB Supervisor] Restarting Homebridge... [5/5/2021, 4:49:05 PM] [HB Supervisor] Starting Homebridge with extra flags: -I [5/5/2021, 4:49:05 PM] [HB Supervisor] Started Homebridge v1.3.4 with PID: 4890 Initializing HAP-NodeJS v0.9.4... [5/5/2021, 4:49:06 PM] Loaded config.json with 0 accessories and 2 platforms. [5/5/2021, 4:49:06 PM] Loaded 0 cached accessories from cachedAccessories. [5/5/2021, 4:49:06 PM] --- [5/5/2021, 4:49:07 PM] Plugin /usr/lib/node_modules/homebridge-bluetooth does not contain a package.json. [5/5/2021, 4:49:08 PM] Loaded plugin: homebridge-config-ui-x@4.41.1 [5/5/2021, 4:49:08 PM] Registering platform 'homebridge-config-ui-x.config' [5/5/2021, 4:49:08 PM] --- [5/5/2021, 4:49:08 PM] Loaded plugin: homebridge-verisure@1.14.0 [5/5/2021, 4:49:08 PM] Registering platform 'homebridge-verisure.verisure' [5/5/2021, 4:49:08 PM] --- [5/5/2021, 4:49:08 PM] Loading 2 platforms... [5/5/2021, 4:49:08 PM] [Config] Initializing config platform... [5/5/2021, 4:49:08 PM] [Config] Running in Service Mode [5/5/2021, 4:49:08 PM] [verisure] Initializing verisure platform... (node:4890) UnhandledPromiseRejectionWarning: Error: getaddrinfo EAI_AGAIN automation01.verisure.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26) (Use node --trace-warnings ... to show where the warning was created) (node:4890) 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:4890) [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. [5/5/2021, 4:49:28 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:49:48 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:50:08 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:50:28 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:50:48 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:51:08 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:51:28 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:51:48 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:52:08 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:52:28 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/5/2021, 4:52:48 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more i

utezduyar commented 3 years ago

If I restart the server, everything is back to normal.

[5/6/2021, 3:28:48 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/6/2021, 3:29:08 PM] [homebridge-verisure] This plugin is taking long time to load and preventing Homebridge from starting. See https://git.io/JtMGR for more info. [5/6/2021, 3:29:22 PM] [Homebridge UI] Homebridge restart request received [5/6/2021, 3:29:22 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process [5/6/2021, 3:29:22 PM] [Homebridge UI] Sending SIGTERM to Homebridge [5/6/2021, 3:29:22 PM] Got SIGTERM, shutting down Homebridge... [5/6/2021, 3:29:27 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [5/6/2021, 3:29:32 PM] [HB Supervisor] Restarting Homebridge... [5/6/2021, 3:29:32 PM] [HB Supervisor] Starting Homebridge with extra flags: -I [5/6/2021, 3:29:32 PM] [HB Supervisor] Started Homebridge v1.3.4 with PID: 15755 Initializing HAP-NodeJS v0.9.4... [5/6/2021, 3:29:33 PM] Loaded config.json with 0 accessories and 2 platforms. [5/6/2021, 3:29:33 PM] Loaded 0 cached accessories from cachedAccessories. [5/6/2021, 3:29:33 PM] --- [5/6/2021, 3:29:34 PM] Plugin /usr/lib/node_modules/homebridge-bluetooth does not contain a package.json.

ptz0n commented 3 years ago

Thanks for reaching out, as your log states:

Error: getaddrinfo EAI_AGAIN automation01.verisure.com

Which means:

EAI_AGAIN is a DNS lookup timed out error, means it is a network connectivity error or proxy related error.

In general terms; you seem to have an issue with your Internet connection.

I hope this helps.

utezduyar commented 3 years ago

I noticed that there are problems, however, an intermittent network connection should not block entire homebridge server from starting up. What do you think?

ptz0n commented 3 years ago

I'm not sure for how long we can delay the platform from registering its accessories without having Homebridge freaking out. Closing this one, please see: https://github.com/ptz0n/homebridge-verisure/issues/61

utezduyar commented 3 years ago

Are we not missing something? Once the problem happens we go in to loop of "This plugin is taking long time to load and preventing Homebridge from starting. Even though I could see that I have internet connection. Also, restarting the homebridge re-triggers things. To me, it seems like retry mechanism is not detecting that the uplink has been restored.

ptz0n commented 3 years ago

We do not yet have such a mechanism as part of the plugin. Therefore I referred to the enhancement issue #61

utezduyar commented 3 years ago

ok thanks