chrisjshull / homebridge-nest

Nest plugin for HomeBridge
700 stars 112 forks source link

ECONNRESET & SIGTERM #540

Closed Matsuo3rd closed 2 years ago

Matsuo3rd commented 2 years ago

Describe the bug Following homebridge-nest update to 4.6.7 (and still 4.6.8) got twice the following error which kills homebridge instance. I read ECONNRESET is ok to be met in the logs, but the SIGTERM is killing my entire homebridge. Nest plugin has been running super stable prior 4.6.7 for 3+ years.

[02/05/2022, 18:29:34] Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:220:20)
[02/05/2022, 18:29:34] [Nest] API observe: error Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:220:20) {
  errno: -54,
  code: 'ECONNRESET',
  syscall: 'read'
}
[02/05/2022, 18:29:34] [Nest] ^^^^^ this message is for information only, it does not mean there is a problem, please do not file a ticket unless you actually have a problem with the function of the plug-in
[02/05/2022, 18:29:34] [Nest] Retrying in 10 seconds.
[02/05/2022, 18:29:34] Got SIGTERM, shutting down Homebridge...

Node.js v16.13.2 Homebridge v1.4.1 (HAP v0.10.2) macOS Catalina

Using former Nest authentication / API (not the new Google one).

marklrs commented 2 years ago

Seeing the same issue also.

adriancable commented 2 years ago

Hmm - that doesn’t look good! You are right that the ECONNRESET is harmless in itself, but no idea where the SIGTERM is coming from. Can you paste a longer log (starting a few lines before the error)? Thanks!

adriancable commented 2 years ago

Update: this should be fixed in 4.6.9. Closing for now, but please re-open if you have further issues after updating. Thanks for reporting!

Matsuo3rd commented 2 years ago

OK. Updated to 4.6.9. Will report back. Thanks for your swift support and great contribution to the community!

ZXSwire3 commented 2 years ago

I just updated Node.js to 16.15.0 and I'm getting the SIGTERM issue even when having the most updated version of the plugin.

[5/11/2022, 5:27:32 PM] Homebridge v1.4.1 (HAP v0.10.2) (Homebridge ECA7) is running on port 52335.

[5/11/2022, 5:35:54 PM] [Homebridge UI] Running Command: npm install --save homebridge-nest@latest
[5/11/2022, 5:36:52 PM] [Homebridge UI] Changes to config.json saved.
[5/11/2022, 5:36:58 PM] [Homebridge UI] Changes to config.json saved.
[5/11/2022, 5:37:22 PM] [Homebridge UI] Changes to config.json saved.
[5/11/2022, 5:37:29 PM] [Homebridge UI] Homebridge restart request received
[5/11/2022, 5:37:29 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[5/11/2022, 5:37:29 PM] [Homebridge UI] Sending SIGTERM to Homebridge
[5/11/2022, 5:37:29 PM] Got SIGTERM, shutting down Homebridge...
[5/11/2022, 5:37:34 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[5/11/2022, 5:37:39 PM] [HB Supervisor] Restarting Homebridge...
[5/11/2022, 5:37:39 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules
[5/11/2022, 5:37:40 PM] [HB Supervisor] Started Homebridge v1.4.1 with PID: 1902
[5/11/2022, 5:37:43 PM] Loaded config.json with 0 accessories and 3 platforms.
[5/11/2022, 5:37:44 PM] Loaded 1 cached accessories from cachedAccessories.
[5/11/2022, 5:37:44 PM] ---
[5/11/2022, 5:37:48 PM] Loaded plugin: homebridge-dummy@0.6.0
[5/11/2022, 5:37:48 PM] Registering accessory 'homebridge-dummy.DummySwitch'
[5/11/2022, 5:37:48 PM] ---
[5/11/2022, 5:37:48 PM] Loaded plugin: homebridge-ecoplug@0.6.0
[5/11/2022, 5:37:48 PM] Registering platform 'homebridge-ecoplug.EcoPlug'
[5/11/2022, 5:37:48 PM] ---

#
# Fatal error in , line 0
# unreachable code
#
#
#
#FailureMessage Object: 0x7edf1fc8
[5/11/2022, 5:37:48 PM] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGTRAP
[5/11/2022, 5:37:53 PM] [HB Supervisor] Restarting Homebridge...
[5/11/2022, 5:37:53 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules
[5/11/2022, 5:37:54 PM] [HB Supervisor] Started Homebridge v1.4.1 with PID: 1938
[5/11/2022, 5:37:57 PM] Loaded config.json with 0 accessories and 3 platforms.
[5/11/2022, 5:37:58 PM] Loaded 1 cached accessories from cachedAccessories.
[5/11/2022, 5:37:58 PM] ---
[5/11/2022, 5:38:01 PM] Loaded plugin: homebridge-dummy@0.6.0
[5/11/2022, 5:38:01 PM] Registering accessory 'homebridge-dummy.DummySwitch'
[5/11/2022, 5:38:01 PM] ---
[5/11/2022, 5:38:01 PM] Loaded plugin: homebridge-ecoplug@0.6.0
[5/11/2022, 5:38:01 PM] Registering platform 'homebridge-ecoplug.EcoPlug'
[5/11/2022, 5:38:01 PM] ---

I'm not sure if it's really the same issue as the one above, but it just hard crashes homebridge when I install it at all. Without the plugin, everything works fine.

Edit: I am now realizing that it was because I tried to restart homebridge that it is doing the SIGTERM, but it doesn't solve the issue that whenever I try to install the plugin it crashes my homebridge

adriancable commented 2 years ago

@ZXSwire3 - not the same issue I'm afraid.

Can you tell me what platform (hardware, OS, etc.) you're running on? The error you're seeing is a hard crash from V8. Googling around this is usually caused by something between you and the hardware, e.g. buggy emulators, broken VM, broken Docker etc. - something very low level.

ZXSwire3 commented 2 years ago

@adriancable That's strange, I'm running it on a raspberry pi 3+ I believe, but when I'm in the homebridge ui, it says that I'm using Ubuntu Focal Fossa (20.04.4 LTS). I set up homebridge with docker. I know this isn't a problem with your plugin, but do you have any suggestions on what do to?

jnubz commented 2 years ago

I'm getting econnreset occasionally, but no sigterms running on an RPi 4b 4gb. As far as I can tell, it's stable as long as everything is updated. But I am not running it in a docker container. Just running directly on the RPi.

adriancable commented 2 years ago

@jnubz - ECONNRESET does not mean anything is wrong.

@ZXSwire3 - my suggestion is you do some Googling. It seems to be specific to Docker and the cause seems to be mismatched library versions. See for example: https://github.com/FlareSolverr/FlareSolverr/issues/258

Matsuo3rd commented 2 years ago

Reporting that since 4.6.9 issue has never popped up on my end (12 days runway)