homebridge-eufy-security / plugin

Homebridge plugin to control certain Eufy Security devices
Apache License 2.0
168 stars 23 forks source link

[Bug]: Livestream crashing homebridge after doorbell (2K) #95

Closed HiddevH closed 2 years ago

HiddevH commented 2 years ago

What happened?

I'm running Homebridge on a docker setup on Linux. Added my Homebase + 2K doorbell today -- I'm able to receive notifications and open live streams on Homekit, but as soon as I ring the doorbell, Homebridge seems to crash and restart.

In the Homebridge logs:

[Doorbell] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.
[6/27/2022, 6:54:52 PM] [EufySecurity-2.1.0-beta.2] ERROR: Doorbell Local livestream didn't start in time. Abort livestream request.
[6/27/2022, 6:54:52 PM] UnhandledPromiseRejection: 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(). The promise rejected with the reason "no started livestream found".
[6/27/2022, 6:54:52 PM] Got SIGTERM, shutting down Homebridge...

When I've enabled 'force immediate notification (without snapshot)':

[6/27/2022, 6:48:02 PM] [EufySecurity-2.1.0-beta.2] ERROR: Doorbell Local livestream didn't start in time. Abort livestream request.
[6/27/2022, 6:48:02 PM] [EufySecurity-2.1.0-beta.2] ERROR: Doorbell Unable to start the livestream: no started livestream found
[6/27/2022, 6:48:02 PM] [EufySecurity-2.1.0-beta.2] INFO:  Doorbell Starting video stream: 1280x720, 30 fps, 299 kbps  (AAC-eld)
[6/27/2022, 6:48:02 PM] TypeError: Cannot read properties of undefined (reading 'url')
    at StreamingDelegate.startStream (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:772:61)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[6/27/2022, 6:48:02 PM] Got SIGTERM, shutting down Homebridge...

I'm a bit clueless on how to further debug this, any help? Thanks for the plugin, seems really great (if it works 👯 )

Device Type

Doorbell (Supported)

Plugin Version

beta (Best Effort)

HomeBridge Version

v1.4.x (Supported)

NodeJS Version

v16 (Supported)

Operating System

Ubuntu 18.04+ (Supported)

Relevant log output

[6/27/2022, 7:07:00 PM] [EufySecurity-2.1.0-beta.2] INFO:  Doorbell Starting video stream: 1280x720, 30 fps, 299 kbps  (AAC-eld)
[6/27/2022, 7:07:00 PM] [EufySecurity-2.1.0-beta.2] INFO:  Doorbell Getting the first frames took 0.25 seconds.
[6/27/2022, 7:07:04 PM] [EufySecurity-2.1.0-beta.2] INFO:  Doorbell Stopped video stream.
[6/27/2022, 7:07:06 PM] [EufySecurity-2.1.0-beta.2] INFO:  Doorbell FFmpeg exited with code: null and signal: SIGKILL (Forced)
[6/27/2022, 7:07:06 PM] [EufySecurity-2.1.0-beta.2] INFO:  Doorbell FFmpeg exited with code: null and signal: SIGKILL (Forced)
[6/27/2022, 7:07:09 PM] [EufySecurity-2.1.0-beta.2] INFO:  eufy HomeBase2-098A station livestream for Doorbell has stopped.
[Doorbell] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.
[6/27/2022, 7:07:32 PM] [EufySecurity-2.1.0-beta.2] ERROR: Doorbell Local livestream didn't start in time. Abort livestream request.
[6/27/2022, 7:07:32 PM] UnhandledPromiseRejection: 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(). The promise rejected with the reason "no started livestream found".
[6/27/2022, 7:07:32 PM] Got SIGTERM, shutting down Homebridge...
[6/27/2022, 7:07:32 PM] [EufySecurity-2.1.0-beta.2] WARN:  Push Closed!
[6/27/2022, 7:07:32 PM] [EufySecurity-2.1.0-beta.2] INFO:  Finished shutdown!
[6/27/2022, 7:07:37 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[6/27/2022, 7:07:42 PM] [HB Supervisor] Restarting Homebridge...

Another error I received (all same procedure to reproduce)

TypeError: ffmpegInput is not iterable
github-actions[bot] commented 2 years ago

Did you check this Common Issues pages ?

HiddevH commented 2 years ago

Update: I guess I missed this entry. Disabling the Homebase in Homebridge seems to at least alleviate the issue. Will try out a few times and give an update later

thieren commented 2 years ago

Hi @HiddevH

I guess I missed this entry.

But even if you failed to set this option there shouldn't occur a crash. Could you enable debug messages and share a new log output? instructions are here

HiddevH commented 2 years ago

Update: I guess I missed this entry. Disabling the Homebase in Homebridge seems to at least alleviate the issue. Will try out a few times and give an update later

This actually fixed my issue. @thieren I can reproduce the issue tomorrow /w debugging enabled. Will get back to you with results

thieren commented 2 years ago

closing since this is resolved

@HiddevH would be cool if you could still try to reproduce. Thx!