Closed zack-kimble closed 7 months ago
Hey there @jjlawren, mind taking a look at this issue as it has been labeled with an integration (sonos
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
sonos documentation sonos source (message by IssueLinks)
I have the same problem, at the moment the connection read timeout errors with my Sonos speakers are increasing: Error calling SonosMediaPlayerEntity.select_source on media_player.sonos_buro: HTTPConnectionPool(host='192.168.1.26', port=1400): Read timed out. (read timeout=9.5) If the affected speaker is activated via the Sonos Android App (e.g. music is played), the control via Homeassistant also works again. Homeassistant Version 2023.10.5 (Docker Container)
I have the same issue. [281472611310912] Error calling SonosMediaPlayerEntity._play_media on media_player.cuisine_2: HTTPConnectionPool(host='192.168.1.57', port=1400): Read timed out. (read timeout=9.5) Sometimes, the media is played but the image of the media is not retrieved from Sonos.
I am also seeing this issue intermittently across multiple sonos service calls.
@jjlawren is is possible to extend the timeout for some of these options like you did in PR #73803?
(some examples which intermittently occurred at different times)
Call-service error. Error calling SonosMediaPlayerEntity.media_pause on media_player.lounge: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5)
Call-service error. Error calling SonosSwitchEntity.send_command on switch.lounge_crossfade: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5)
Call-service error. Error calling SonosMediaPlayerEntity.set_repeat on media_player.lounge: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5)
Call-service error. Error calling SonosSpeaker.join on Girls: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5)
I am also seeing this issue intermittently across multiple sonos service calls.
@jjlawren is is possible to extend the timeout for some of these options like you did in PR #73803?
(some examples which intermittently occurred at different times)
Call-service error. Error calling SonosMediaPlayerEntity.media_pause on media_player.lounge: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5) Call-service error. Error calling SonosSwitchEntity.send_command on switch.lounge_crossfade: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5) Call-service error. Error calling SonosMediaPlayerEntity.set_repeat on media_player.lounge: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5) Call-service error. Error calling SonosSpeaker.join on Girls: HTTPConnectionPool(host='172.x.x.x', port=1400): Read timed out. (read timeout=9.5)
The timeouts added in the linked PR were for operations which are known to take a long time as they're waiting for an external service to respond. The types of actions you're taking should be instantaneous and extending timeouts would not help. They imply there are connectivity/networking problems or the speaker has failed to respond for some unknown reason.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
I have two Sonos devices that I play media on either from the media mount on my HA server or via Spotify. In the past few weeks they've started to have an intermittent timeout error.
The error only happens for the actual play service command. Pause playback and volume setting are working without error. Also, while there's a timeout in the traceback, the track for the Sonos is actually changed to the correct track, just not started.
When I try again hours later, the integration works.
What version of Home Assistant Core has the issue?
System Information version | core-2023.8.2 -- | -- installation_type | Home Assistant Container dev | false hassio | false docker | true user | root virtualenv | false python_version | 3.11.4 os_name | Linux os_version | 5.15.0-1038-raspi arch | aarch64 timezone | America/New_York config_dir | /config
Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okDashboards
dashboards | 1 -- | -- resources | 0 mode | auto-genRecorder
oldest_recorder_run | October 14, 2023 at 8:15 PM -- | -- current_recorder_run | October 14, 2023 at 4:15 PM estimated_db_size | 2.64 MiB database_engine | sqlite database_version | 3.41.2What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
sonos
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sonos
Diagnostics information
I'm unable to retrieve the diagnostics. When attempting to download from the integration settings, Chrome reports "Failed - Unknown server error. Please try again, or contact the server administrator."
I'm able to successfully download other integrations diagnostics (Zigby and Lutron).
I turned on debug logs in the Sonos integration and copied the log during a timeout event. Removed auths. File attached sonos_error_logs.txt
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
After reloading the integration, I got the following warning (and an error in the web app about polling).
2023-10-22 10:44:21.112 WARNING (MainThread) [homeassistant.components.sonos] Subscription to 192.168.1.6 failed, attempting to poll directly
I updated ufw on the host and reloaded and no longer get this warning/error. Same timeout issue, however.
Restarting the host resolves the issue for a few weeks.