johnlemonse / homebridge-telldus

36 stars 22 forks source link

Homebridge not loading because of Telldus sensors #83

Open ekhalil-SE opened 3 years ago

ekhalil-SE commented 3 years ago

Always after Rasperry Pi is restarted (or after power shut down), Homebridge will not load and I get the following error: [7/22/2020, 9:28:02 AM] [Telldus Liv!e] request to https://api.telldus.com/json/sensors/list failed, reason: getaddrinfo EAI_AGAIN api.telldus.com (node:613) UnhandledPromiseRejectionWarning: FetchError: request to https://api.telldus.com/json/sensors/list failed, reason: getaddrinfo EAI_AGAIN api.telldus.com at ClientRequest. (/usr/lib/node_modules/homebridge-telldus/node_modules/node-fetch/lib/index.js:1455:11) at ClientRequest.emit (events.js:315:20) at TLSSocket.socketErrorListener (_http_client.js:426:9) at TLSSocket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21) (node:613) 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: 1) (node:613) [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. [7/22/2020, 9:28:04 AM] [Config] Homebridge Config UI X v4.23.2 is listening on :: port 8581

To fix this, I just remove one of the sensors in Telldus Live! then reboot Homebridge and everything will start working again. I then add back the sensor which I removed and restart again and things will continue working again. Everything will continue working until I restart the Raspberry Pi or after complete power shutdown.

Appreciate any help on this please.

mifi commented 3 years ago

This is very strange. Sounds almost like an issue with telldus api (EAI_AGAIN)

ekhalil-SE commented 3 years ago

Any idea how I can fix this EAI_AGAIN issue please? This issue only happens after power cycling of the Raspberry Pi. It works fine after a normal restart though.

mifi commented 3 years ago

are you running homebridge in pm2?

ekhalil-SE commented 3 years ago

Yes, I use pm2 for having homebridge start on boot.

mifi commented 3 years ago

Maybe if you can somehow delay the startup of homebridge, and see if that helps