bwp91 / homebridge-ewelink

Homebridge plugin to integrate eWeLink devices into HomeKit.
MIT License
384 stars 126 forks source link

ECONNRESET Crash on Startup #460

Closed pickanothername closed 1 year ago

pickanothername commented 1 year ago

What issue do you have? Please be as thorough and explicit as possible.

Hello! Sometimes when I restart Homebridge, this plugin causes a Homebridge crash. This is not consistent but is quite frequent. The errors are either "ECONNRESET" or "ECONNREFUSED". Full error in the first log below.

This usually happens 1-3 times in a row, then starts up normally. (As shown in the second log below.)

Details of your setup.

Please paste any relevant logs below.

Startup with crash:

[1/30/2023, 2:45:45 AM] FetchError: request to http://192.168.4.38:12108/status failed, reason: read ECONNRESET
    at ClientRequest.<anonymous> (/homebridge/node_modules/homebridge-konnected/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:513:28)
    at Socket.socketErrorListener (node:_http_client:496:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
[1/30/2023, 2:45:45 AM] Got SIGTERM, shutting down Homebridge...

Normal startup:

[1/30/2023, 2:46:48 AM] [eWeLink] Fetching devices from eWeLink home/id [My Home] [[REDACTED]].
[1/30/2023, 2:46:53 AM] [eWeLink] LAN monitoring started.
[1/30/2023, 2:46:53 AM] [eWeLink] [RF Bridge] initialising with options {"logging":"standard","resetOnStartup":true}.
[1/30/2023, 2:46:53 AM] [eWeLink] [My Remote] has been removed from Homebridge.
[1/30/2023, 2:46:53 AM] [eWeLink] [My Remote] has been added to Homebridge.
[1/30/2023, 2:46:53 AM] [eWeLink] [My Remote] initialising with options {"logging":"standard"}.
[1/30/2023, 2:46:53 AM] [eWeLink] [RF Bridge] using a shared device with the cloud may cause errors, use your main eWeLink account.
[1/30/2023, 2:46:53 AM] [eWeLink] [RF Bridge] has been reported [offline] via WS.
[1/30/2023, 2:46:53 AM] [eWeLink] [RF Bridge] initialised and LAN mode unavailable as not discovered/supported [28:RFBridge433].
[1/30/2023, 2:46:53 AM] [eWeLink] [H1 Fan] initialising with options {"hideLight":true,"logging":"standard"}.
[1/30/2023, 2:46:53 AM] [eWeLink] [H1 Fan] initialised and found locally with IP [192.168.4.39] [34:iFan02].
[1/30/2023, 2:46:53 AM] [eWeLink] Internal API listening on port [44493].
[1/30/2023, 2:46:55 AM] [eWeLink] ✓ Setup complete. Thanks for using this plugin, I hope you find it helpful!
bwp91 commented 1 year ago

Hi @JuniorGenius

If you look at the error logs you can see that this error is generated by the konnected plugin not the ewelink plugin 👍🏻

pickanothername commented 1 year ago

Hi @JuniorGenius

If you look at the error logs you can see that this error is generated by the konnected plugin not the ewelink plugin 👍🏻

Oh boy. My apologies. I must've posted the wrong log, but now I can't find the one I meant to post. Perhaps I'm going crazy! I'll close the issue until/unless I can reproduce the error again. Thank you

bwp91 commented 1 year ago

I tend to catch http errors well with this plugin and just wait 30 seconds and try again. Not saying it is bullet proof, so of course if you get an error log which crashes homebridge please reopen!

pickanothername commented 1 year ago

I tend to catch http errors well with this plugin and just wait 30 seconds and try again. Not saying it is bullet proof, so of course if you get an error log which crashes homebridge please reopen!

Absolutely, will do. Thank you and sorry for wasting your time! 😅

bwp91 commented 1 year ago

Not at all! 🙂