ring: Failed to activate stream

Streaming Issue

I can receive snapshot and notifications just fine but I am unable to get a livestream to work through the home app. It works fine on the ring app. I am fairly new to home bridge and I am not sure if I missed something while setting it up. Any help would be appreciated. Thank you.

Proposed Solution

The specific cause of the error could be related to incorrect data handling, data offsets, or indices during the cryptographic operations. However, I am unsure and am requesting help.

Environment

Homebridge

What operating system are you on?

Mac

Relevant log output

[8/9/2023, 12:22:17 AM] [Ring] Activating stream for Front Door (0.482s)
[8/9/2023, 12:22:17 AM] [Ring] WebSocket connected for Front Door
[8/9/2023, 12:22:18 AM] [Ring] iceConnectionStateChange: completed
[8/9/2023, 12:22:18 AM] [Ring] RangeError: offset is out of bounds
    at Uint8Array.set (<anonymous>)
    at Function.padStart (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:972:13)
    at Function.encodeSignature (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:940:22)
    at Function.sign (/usr/local/lib/node_modules/homebridge-ring/node_modules/@peculiar/webcrypto/build/webcrypto.js:1575:54)
    at EcdsaProvider.onSign (/usr/local/lib/node_modules/homebridge-ring/node_modules/@peculiar/webcrypto/build/webcrypto.js:1737:25)
    at EcdsaProvider.sign (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:157:28)
    at SubtleCrypto.sign (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:1405:39)
    at Function.create (/usr/local/lib/node_modules/homebridge-ring/node_modules/@peculiar/x509/build/x509.cjs.js:2407:35)
    at Function.value [as createSelfSignedCertificateWithKey] (/usr/local/lib/node_modules/homebridge-ring/node_modules/dtls/src/context/cipher.ts:108:18)
    at RTCDtlsTransport.setupCertificate (/usr/local/lib/node_modules/homebridge-ring/node_modules/werift/src/transport/dtls.ts:76:9)
[8/9/2023, 12:22:18 AM] [Ring] Failed to activate stream
[8/9/2023, 12:22:18 AM] [Ring] RangeError: offset is out of bounds
    at Uint8Array.set (<anonymous>)
    at Function.padStart (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:972:13)
    at Function.encodeSignature (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:940:22)
    at Function.sign (/usr/local/lib/node_modules/homebridge-ring/node_modules/@peculiar/webcrypto/build/webcrypto.js:1575:54)
    at EcdsaProvider.onSign (/usr/local/lib/node_modules/homebridge-ring/node_modules/@peculiar/webcrypto/build/webcrypto.js:1737:25)
    at EcdsaProvider.sign (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:157:28)
    at SubtleCrypto.sign (/usr/local/lib/node_modules/homebridge-ring/node_modules/webcrypto-core/build/webcrypto-core.js:1405:39)
    at Function.create (/usr/local/lib/node_modules/homebridge-ring/node_modules/@peculiar/x509/build/x509.cjs.js:2407:35)
    at Function.value [as createSelfSignedCertificateWithKey] (/usr/local/lib/node_modules/homebridge-ring/node_modules/dtls/src/context/cipher.ts:108:18)
    at RTCDtlsTransport.setupCertificate (/usr/local/lib/node_modules/homebridge-ring/node_modules/werift/src/transport/dtls.ts:76:9)
[8/9/2023, 12:22:18 AM] [Ring] connectionStateChange: closed
[8/9/2023, 12:22:18 AM] [Ring] iceConnectionStateChange: closed
[8/9/2023, 12:22:18 AM] [Ring] Call ended before answered
[8/9/2023, 12:27:31 AM] [Homebridge UI] [homebridge-ring] Terminating child process...
[8/9/2023, 12:27:31 AM] [Homebridge UI] [homebridge-ring] Child process ended

Honesty Time

  • I swear this is worth your time!

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 41 (5 by maintainers)

Most upvoted comments

This is a strange issue as it appears at first glance to be unrelated to any of the recent changes in ring-homebridge/ring-client-api, which is further confirmed by the fact that users are having it with v11.8.1 as well. It looks like some kind of dependency conflict with some downstream package as I’m not sure why the standalone dtls package is installed.

Unfortunately, I’m travelling this week and won’t have any chance to dig into it until sometime early next week.

Thanks everyone for contributing and working on this. I can confirm upgrading to 12.0 beta 2 installed pvtsutils 1.3.2 & resolved the problem.

Thanks for the quick response @cebrakadabra. Give 12.0.0-beta.2 a try 🤞.

For context, it looks like there is an npm bug where it doesn’t respect the override field after a dep has already been installed 😞. I switched to listing 1.3.2 as a direct dependency, which seems to fix it on my end, but curious how it goes for other users.

It works! Thanks so much!

Thanks for the quick response @cebrakadabra. Give 12.0.0-beta.2 a try 🤞.

For context, it looks like there is an npm bug where it doesn’t respect the override field after a dep has already been installed 😞. I switched to listing 1.3.2 as a direct dependency, which seems to fix it on my end, but curious how it goes for other users.

One of the most confusing things for me is that I just did my Homebridge install fresh last night and I only received pvtsutils 1.3.2, even though 1.3.3 was available. I had to manually update to 1.3.3 to get it.

Any idea of when it will move out of beta and become available through the Homebridge interface? Thanks very much

The beta should be installable via the Homebridge UI even now, that’s how I did it. Just select install alternate version and select the v12.0.0-beta.2 version from the drop down list.

Thank you all SO much for your amazing help with this! I can also confirm that v12.0.0-beta.2 resolved the issues with live streaming!

Thanks for the quick response @cebrakadabra. Give 12.0.0-beta.2 a try 🤞.

For context, it looks like there is an npm bug where it doesn’t respect the override field after a dep has already been installed 😞. I switched to listing 1.3.2 as a direct dependency, which seems to fix it on my end, but curious how it goes for other users.

@dgreif @tsightler

  1. Using 12.0.0-beta.2
  2. restarted the homebridge server
  3. confirming i see 1.3.2
  4. and a working live stream 🥳

Thank you! ❤️

@tsightler npm can be weird that way. It has a local cache that it checks first, so if you had previously installed 1.3.2, it would see that and say “this version satisfies my needs” and just use that. I’m guessing that’s what happened

@dgreif appreciate the effort and release! - I tried and it didn’t update it within homebridge-ring my pvtsutils is still set to 1.3.3 as part of the package.json within the node_modules of homebridge-ring

Unfortunately the npm install log disappears to quickly in the homebridge ui to tell. It might only will do so, if I’d remove homebridge-ring completely and re-install.

Thank you for the thorough investigation work @tsightler!

I just released 12.0.0-beta.1, which should “pin” the pvtsutils version to 1.3.2. I say “should” because I’m seeing some funky behavior with npm workspaces locally, but the actual install doesn’t use workspaces. Let us know if the beta version works for y’all!

Thanks everyone that has provided npm output. I have hidden them for now to make the thread more readable but they were extremely useful. Going through the details the only difference I could find between my working setup and the non-working ones was the version of pvtsutils. My working setup was using 1.3.2 while the broken ones above have 1.3.3, and sure enough, updating my version to 1.3.3 reproduces the issue.

Also, v1.3.3 was updated 8 days ago and a very similar issue with the padStart function has already been reported on the pvtsutils project page: https://github.com/PeculiarVentures/pvtsutils/issues/12

Manually reverting the package back to pvtsutils v1.3.2 solves the issue which is the workaround for now.

  • Homebridge is running on macOS Monterey
  • The other plugins are: Homebridge Hue, Homebridge Xiaomi Fan
  • The issue appears regardless where I try to open the stream. I am on Sonoma beta, iOS 17 Beta, tvOS 17 beta. I haven’t tested it on a non-beta OS, yet.

Seeing a lot of reports of this, including some in the Google Nest homebridge plugin. I agree with @tsightler that it’s likely a dependency (or sub dependency) that changed, but I don’t have any specific ideas on which one at this point.

I have not been able to reproduce this myself yet. For those who are experience it, could you provide the following info:

  • Node.js version
  • homebridge-ring version
  • Camera model experiencing issues
  • iOS/TvOS version, including both iPhone and home hub (AppleTV, HomePod, etc)

This should hopefully help us narrow down the cause.

@DerMuri I am using homebridge-ring v11.8.1

I have the exact same issue. Are you also using the v12 beta of the plugin?