iklein99 / homebridge-smartthings

This is a plugin to Homebridge to connect your Smartthings network into Apple Home Kit.
Apache License 2.0
160 stars 53 forks source link

Homebridge hangs and stops responding #257

Open yffud opened 5 months ago

yffud commented 5 months ago

https://github.com/iklein99/homebridge-smartthings/blob/44894ec3063e723e757fb4e1608eb9d39c32bb20/src/platform.ts#L73

If the code gets to this catch error it hangs the code and Homebridge until Homebridge is restarted.

Could there be a retry or continue logic here?

-- Issue logged with Homebridge https://github.com/homebridge/homebridge/issues/3615

Homebridge will stop responding to inputs from HomeKit until it is rebooted.

The last log messages before hanging will be something similar from the Smartthings Plugin

[5/14/2024, 4:33:14 AM] [Smartthings Plug (IK)] Error getting devices from Smartthings: Error: getaddrinfo EAI_AGAIN api.smartthings.com [5/14/2024, 4:33:14 AM] [Smartthings Plug (IK)] Could not load devices from Smartthings: undefined. Check your configuration

No more long messages after than until rebooted

spiazza1 commented 3 months ago

Was this issue addressed? It is still affecting v1.5.21.

yffud commented 3 months ago

I don’t believe so . I asked ChatGPT to help me write some really hackey retry code to wrap around it to kludge a temporary fix

spiazza1 commented 3 months ago

I'm going to give this plugin a shot: Restart Plugin Using the value @daily in order to restart the service once a day.

yffud commented 3 months ago

I'm going to give this plugin a shot: Restart Plugin Using the value @daily in order to restart the service once a day.

Good idea , my first hack was a daily restart of the service by crontab , but sometimes the service was left hung for a few hours then when I needed it