colinbendell / homebridge-blink-for-home

Blink For Home Camera Homebridge plugin
MIT License
88 stars 27 forks source link

Error: "The session has been destroyed" #43

Closed leny closed 3 years ago

leny commented 3 years ago

Hello, thanks for this great plugin!

I'm using it for 2 days and it's working well, until, at night, I got this error:

[12/01/2021, 02:02:09] [Blink] Error: read ETIMEDOUT
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20) {
  errno: -110,
  code: 'ETIMEDOUT',
  syscall: 'read'
}
(node:21187) UnhandledPromiseRejectionWarning: Error: read ETIMEDOUT
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21187) 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: 5)
(node:21187) [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.
[12/01/2021, 07:24:44] [Blink] Refreshing snapshot for Blink Salon
[12/01/2021, 07:24:44] [Blink] Error [ERR_HTTP2_INVALID_SESSION]: The session has been destroyed
    at ClientHttp2Session.request (internal/http2/core.js:1606:13)
    at doFetch (/usr/local/lib/node_modules/homebridge-blink-for-home/node_modules/fetch-h2/dist/lib/fetch-http2.js:51:32)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'ERR_HTTP2_INVALID_SESSION'
}
Error [ERR_HTTP2_INVALID_SESSION]: The session has been destroyed
    at ClientHttp2Session.request (internal/http2/core.js:1606:13)
    at doFetch (/usr/local/lib/node_modules/homebridge-blink-for-home/node_modules/fetch-h2/dist/lib/fetch-http2.js:51:32)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'ERR_HTTP2_INVALID_SESSION'
}

It seems that some network errors are not catched - then makes the plugin to crash. A restart of homebridge fixes the issue, but the whole point of the stuff is to not having to reboot it every morning.

I will try to take a look at the code, but if you can point me in the right direction, it would be useful.

Thanks again,

leny commented 3 years ago

Small update: when the privacy mode is enabled, I don't have the issue. Edit: I still had it... but it took two days instead of one :/

reziCCAA commented 3 years ago

I have the same problem.

gdotp01 commented 3 years ago

I get this occasionally and it seems to stop some , but not all, homebridge plugins working until I restart homebridge. I synchronise this and my ring alarm and when blink fails with this error the ring alarm also seems to be failing without any effort messages in the log.

magaHH commented 3 years ago

I updated node.js from 12.18.2 to 14.15.4 and this issue seems to be gone...

leny commented 3 years ago

I'm already on node 14.15.1, will try the 14.15.4

rpawlik commented 3 years ago

I'm facing the same issue. It'll work for maybe a day or so, then HomeBridge has to be restarted. It doesn't appear to affect any other plugins. I'm running HomeBridge 1.1.7 and node 14.15.1. I'll try updating node as well.

gdotp01 commented 3 years ago

4CF262BD-7257-4924-BA27-18703FF8E049 0F444CB0-58C7-41C1-AE9C-71EE8B3D2315 5D48DD08-F4F7-43DC-9695-12EBDEDF75E1

This happened again last night. Most plugins continued to work but the ring one failed as well.

hunterpaul commented 3 years ago

Same issue for me too. Having to restart Homebridge to rectify the problem on a regular basis. When it happens, my Blink automations fail

xImportExportx commented 3 years ago

I am having the same issue too just to add. I’m running the docker container version of homebridge. Any ideas what the underlying issue is?

gdotp01 commented 3 years ago

I’m getting round this until it’s fixed by using the IFTTT service to turn them off. It only seems to be the turn off that causes the issue.

colinbendell commented 3 years ago

This uses a long running TLS socket which appears to trigger out of hand socket handling. I've added some additional network handling and I'll see if I can capture these ephemeral SESSION hangups on the h2 stream. stay tuned.

cristian5th commented 3 years ago

I’m getting round this until it’s fixed by using the IFTTT service to turn them off. It only seems to be the turn off that causes the issue.

Me too, I'm only getting the issue during the turn off request. Automations for turning on are working.

hunterpaul commented 3 years ago

Confirming that the new version is working fine for me. No longer seeing this problem and my automations are working great. Thank you

colinbendell commented 3 years ago

great!