Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nest Camera API Call high error rate ExecuteDeviceCommand endpoint #132438

Closed
arnoudkooi opened this issue Dec 5, 2024 · 12 comments
Closed

Nest Camera API Call high error rate ExecuteDeviceCommand endpoint #132438

arnoudkooi opened this issue Dec 5, 2024 · 12 comments
Assignees

Comments

@arnoudkooi
Copy link

arnoudkooi commented Dec 5, 2024

The problem

This is a follow up of #130061
After upgrading to 2024.12.0 I get the Nest Error again within a few hours, causing the stream not to start.
In the screenshot the Google Cloud data can be seen.

The error on screen of the dashboard is:
Error:
Failed to start WebRTC stream: Nest API error. Bad Request response from API (400): INVALID_ARGUMENT
(400): offerSp contains an invalid value.

If there are any clues how to troubleshoot it myself, Id be happy to research.

I understood the delay should be 30 seconds for API calls, however it shows a lot more calls.

CleanShot 2024-12-05 at 23 32 16@2x

CleanShot 2024-12-05 at 23 46 14@2x

What version of Home Assistant Core has the issue?

core-2024.12.0

What was the last working version of Home Assistant Core?

core-2024.10.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Nest

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nest

Diagnostics information

nest-01JC3TA0GB3ERTT0B3CHQ61AJZ-Voordeur camera-2cefd9efacad846c2479e67be34470f2.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Dec 5, 2024

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (nest) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of nest can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign nest Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


nest documentation
nest source
(message by IssueLinks)

@arnoudkooi arnoudkooi changed the title Nest Camera Nest Camera API Call high error rate ExecuteDeviceCommand endpoint Dec 5, 2024
@arnoudkooi
Copy link
Author

I keep experiencing issues on any version above 2024.10.4.
I removed the integration and setup a new GC project oath and so on, with no success.

There are still lots of errors, leading to the stream not working.
To me it seems the 30 second timeout is not respected, looking at below log.

In the scrrenshot you can see the errors are increasing over time. A reset of home assistant seems to help?
Point 1 is the upgrade to 2024.12.3, point 2 is a restart of homeassistant.
CleanShot 2024-12-16 at 00 33 11@2x

@allenporter any clues? Happy to dive in deeper...

2024-12-15 22:27:36.071 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:27:36.071 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'vXYUXPubFRsmTAoKAAiSWigaIAMQ'}}
2024-12-15 22:27:36.673 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExecuteDeviceCommand API for the user.
2024-12-15 22:27:36.677 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:37:36.677078+00:00
2024-12-15 22:27:45.214 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream rUqyYh3Q5-PdZwoKAAiSWigaIAMQ
2024-12-15 22:27:45.215 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:27:45.215 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'rUqyYh3Q5-PdZwoKAAiSWigaIAMQ'}}
2024-12-15 22:27:45.980 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream a8QMw_5EGSsgFgoKAAiSWigaIAMQ
2024-12-15 22:27:45.980 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:27:45.980 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'a8QMw_5EGSsgFgoKAAiSWigaIAMQ'}}
2024-12-15 22:27:46.065 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:27:46.065 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:37:46.065796+00:00
2024-12-15 22:27:46.900 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:27:46.900 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:37:46.900638+00:00
2024-12-15 22:28:04.049 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream JAYyhGPchj-YBAoKAAiSWigaIAMQ
2024-12-15 22:28:04.049 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:04.049 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'JAYyhGPchj-YBAoKAAiSWigaIAMQ'}}
2024-12-15 22:28:04.978 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:28:04.979 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:04.979187+00:00
2024-12-15 22:28:16.625 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream wRJh1OFlNrnFkAoKAAiSWigaIAMQ
2024-12-15 22:28:16.625 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:16.626 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'wRJh1OFlNrnFkAoKAAiSWigaIAMQ'}}
2024-12-15 22:28:17.538 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:28:17.539 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:17.539211+00:00
2024-12-15 22:28:41.108 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream arCqoikOXTXbTgoKAAiSWigaIAMQ
2024-12-15 22:28:41.109 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:41.109 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'arCqoikOXTXbTgoKAAiSWigaIAMQ'}}
2024-12-15 22:28:42.020 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:28:42.020 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:42.020632+00:00
2024-12-15 22:28:43.301 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream m4MG8QmhEamsYgoKAAiSWigaIAMQ
2024-12-15 22:28:43.302 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:43.302 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'm4MG8QmhEamsYgoKAAiSWigaIAMQ'}}
2024-12-15 22:28:44.185 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:28:44.186 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:44.185915+00:00
2024-12-15 22:28:47.618 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream FVJkvh7f-KD-oAoKAAiSWigaIAMQ
2024-12-15 22:28:47.618 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:47.618 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'FVJkvh7f-KD-oAoKAAiSWigaIAMQ'}}
2024-12-15 22:28:47.664 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream aayloxtQSx2aUgoKAAiSWigaIAMQ
2024-12-15 22:28:47.664 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:47.664 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'aayloxtQSx2aUgoKAAiSWigaIAMQ'}}
2024-12-15 22:28:47.670 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream 8pDEc296WjzFHgoKAAiSWigaIAMQ
2024-12-15 22:28:47.670 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:47.670 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': '8pDEc296WjzFHgoKAAiSWigaIAMQ'}}
2024-12-15 22:28:47.740 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream OJVczuH_zakRLgoKAAiSWigaIAMQ
2024-12-15 22:28:47.740 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:47.740 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'OJVczuH_zakRLgoKAAiSWigaIAMQ'}}
2024-12-15 22:28:47.860 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream O92biyNGr6alegoKAAiSWigaIAMQ
2024-12-15 22:28:47.861 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:47.861 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'O92biyNGr6alegoKAAiSWigaIAMQ'}}
2024-12-15 22:28:47.929 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream P_41ndfj-ukUNgoKAAiSWigaIAMQ
2024-12-15 22:28:47.930 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:47.930 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'P_41ndfj-ukUNgoKAAiSWigaIAMQ'}}
2024-12-15 22:28:47.967 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream -bwdw1uMpbzRYwoKAAiSWigaIAMQ
2024-12-15 22:28:47.967 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:47.968 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': '-bwdw1uMpbzRYwoKAAiSWigaIAMQ'}}
2024-12-15 22:28:48.147 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream yIz6IWAfmSrdJgoKAAiSWigaIAMQ
2024-12-15 22:28:48.148 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:48.148 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'yIz6IWAfmSrdJgoKAAiSWigaIAMQ'}}
2024-12-15 22:28:48.299 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExtendWebRtcStream API for the user.
2024-12-15 22:28:48.299 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.299681+00:00
2024-12-15 22:28:48.300 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream tFnYSy6hMVClWwoKAAiSWigaIAMQ
2024-12-15 22:28:48.300 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:48.301 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'tFnYSy6hMVClWwoKAAiSWigaIAMQ'}}
2024-12-15 22:28:48.401 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream iqUPqOOBspnrdAoKAAiSWigaIAMQ
2024-12-15 22:28:48.401 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:48.401 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'iqUPqOOBspnrdAoKAAiSWigaIAMQ'}}
2024-12-15 22:28:48.428 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream x4esmY0ikUE2sAoKAAiSWigaIAMQ
2024-12-15 22:28:48.429 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:48.429 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'x4esmY0ikUE2sAoKAAiSWigaIAMQ'}}
2024-12-15 22:28:48.509 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:28:48.510 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.510147+00:00
2024-12-15 22:28:48.527 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExtendWebRtcStream API for the user.
2024-12-15 22:28:48.527 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.527524+00:00
2024-12-15 22:28:48.593 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Bad Request response from API (400): FAILED_PRECONDITION (400): WebRtc error caused by invalid session or user id mismatch.
2024-12-15 22:28:48.593 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.593770+00:00
2024-12-15 22:28:48.750 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExtendWebRtcStream API for the user.
2024-12-15 22:28:48.751 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.751137+00:00
2024-12-15 22:28:48.858 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExtendWebRtcStream API for the user.
2024-12-15 22:28:48.859 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.858992+00:00
2024-12-15 22:28:48.967 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExtendWebRtcStream API for the user.
2024-12-15 22:28:48.967 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.967459+00:00
2024-12-15 22:28:48.987 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExtendWebRtcStream API for the user.
2024-12-15 22:28:48.987 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:48.987531+00:00
2024-12-15 22:28:49.014 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExtendWebRtcStream API for the user.
2024-12-15 22:28:49.015 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:49.015074+00:00
2024-12-15 22:28:49.207 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExecuteDeviceCommand API for the user.
2024-12-15 22:28:49.208 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:49.208125+00:00
2024-12-15 22:28:49.313 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExecuteDeviceCommand API for the user.
2024-12-15 22:28:49.314 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:49.314083+00:00
2024-12-15 22:28:52.440 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream ai80qdalL8pCGQoKAAiSWigaIAMQ
2024-12-15 22:28:52.441 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:28:52.441 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'ai80qdalL8pCGQoKAAiSWigaIAMQ'}}
2024-12-15 22:28:52.924 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExecuteDeviceCommand API for the user.
2024-12-15 22:28:52.925 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:38:52.924987+00:00
2024-12-15 22:29:13.621 DEBUG (MainThread) [homeassistant.components.nest.camera] Extending WebRTC stream zfIChFYag-_2tAoKAAiSWigaIAMQ
2024-12-15 22:29:13.621 DEBUG (MainThread) [google_nest_sdm.auth] request[post]=https://smartdevicemanagement.googleapis.com/v1/enterprises/HIDDEN/devices/HIDDEN:executeCommand
2024-12-15 22:29:13.622 DEBUG (MainThread) [google_nest_sdm.auth] request[post json]={'command': 'sdm.devices.commands.CameraLiveStream.ExtendWebRtcStream', 'params': {'mediaSessionId': 'zfIChFYag-_2tAoKAAiSWigaIAMQ'}}
2024-12-15 22:29:14.199 DEBUG (MainThread) [homeassistant.components.nest.camera] Failed to refresh stream: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExecuteDeviceCommand API for the user.
2024-12-15 22:29:14.200 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-15 21:39:14.200319+00:00

@allenporter
Copy link
Contributor

How many cameras is this?

These all appear to be separate webrtc sessions created.

Can you describe your frontend dashboard configuration for showing your camera streams? I'm curious if it's set to live but suspect it may be set to auto.

@allenporter
Copy link
Contributor

It might be easier to diagnose if starting from a fresh integration startup so we can see why all those extra sessions are being created. We should see a session created, then scheduled for expiration when it expires a few minutes later, and that should be it. If there are more requests than that then there is a problem.

Would be helpful to know how many cameras and what you're doing from the viewing side, and also to have a diagnostics trace along side the logs.

A separate issue might be better at this point given it's a new separate issue with the same symptoms.

@arnoudkooi
Copy link
Author

arnoudkooi commented Dec 16, 2024

I have 1 camera, it is displayed in 1 dashboard, the card is set to live

The frontend setup is as follows

  • Displayed on a tablet with fully kiosk
  • Tablet is turned on when camera detects event
  • If the screen is not on, fully kiosk reload start page is triggered (sometimes the stream is black when stream turns on, without a reload)
  • Screen turns off after 2 minutes

It might be easier to diagnose if starting from a fresh integration startup

I already re-setup the integration, or do you mean something different?

@allenporter
Copy link
Contributor

I have 1 camera, it is displayed in 1 dashboard, the card is set to live

The frontend setup is as follows

  • Displayed on a tablet with fully kiosk
  • Tablet is turned on when camera detects event
  • If the screen is not on, fully kiosk reload start page is triggered (sometimes the stream is black when stream turns on, without a reload)
  • Screen turns off after 2 minutes

OK -- that sounds like it is leaking WebRTC sessions, causing new sessions to be created without closing the old ones.

It might be easier to diagnose if starting from a fresh integration startup

I already re-setup the integration, or do you mean something different?

No, not setup, but startup of home assistant. The log has a bunch of existing sessions, but not showing how the problem starts given the sessions all already exist.

@arnoudkooi
Copy link
Author

ok, is there a way to close the WebRTC sessions?

Will look at generating a better log.

@allenporter
Copy link
Contributor

ok, is there a way to close the WebRTC sessions?

Will look at generating a better log.

My impression is they are typically closed by the frontend browser when the stream is closed in the browser (e.g. navigating away, closing the window) or when the websocket is closed by the browser. I'm not sure how that differs from reloading the view. Perhaps you can share details about how the reloading works? I'm not familiar with this.

@arnoudkooi
Copy link
Author

arnoudkooi commented Dec 16, 2024

The reload and screen on/off can be triggered via the fully kiosk integration.
A quick test it seems this is not causing errors:

CleanShot X 2024-12-16 01 58 30
Looks like the streams are opened and closed ok in below log extract

It feels the errors start occuring when the camera starts detecting events.

2024-12-16 01:56:55.529 DEBUG (MainThread) [homeassistant.components.nest.camera] Started WebRTC session 01JF6FFNAKMSX3EKY2V7R4B8CT, JBoH0T8ESQyDrgoKAAiSWigaIAMQ
2024-12-16 01:56:55.530 DEBUG (MainThread) [homeassistant.components.nest.camera] Scheduling stream refresh for 2024-12-16 01:01:25.469928+00:00
2024-12-16 01:57:07.079 DEBUG (MainThread) [homeassistant.components.nest.camera] Closing WebRTC session 01JF6FFNAKMSX3EKY2V7R4B8CT, JBoH0T8ESQyDrgoKAAiSWigaIAMQ

@allenporter
Copy link
Contributor

That all looks fine -- Started WebRTC session then Closing WebRTC session which is correct. The problem is if we see many more Started WebRTC session log lines that never close.

@arnoudkooi
Copy link
Author

arnoudkooi commented Dec 16, 2024

I do see 33 start vs. 20 close operations in my logs this morning.
For example 01JF7ERNMYE05DHPJG3YCVRVD5 on line 878 is opened but not closed.

home-assistant_nest_2024-12-16T12-50-54.102Z.log

Any suggestion how to go about this.
Also curious, why is this an issue after the 2024.11 update?

Btw HACS WebRTC is not used, now have removed it.

@arnoudkooi
Copy link
Author

Looks like it is resolved now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants