home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.68k stars 30.81k forks source link

Sonos KeyError: 'AlarmClock' #69511

Closed eikowagenknecht closed 2 years ago

eikowagenknecht commented 2 years ago

The problem

After the update to 2022.4.0 I've seen this for the first time:

Logger: aiohttp.server
Source: components/sonos/speaker.py:418
First occurred: 07:26:45 (10 occurrences)
Last logged: 07:27:45

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/soco/events_asyncio.py", line 147, in notify
    subscription.send_event(event)
  File "/usr/local/lib/python3.9/site-packages/soco/events_base.py", line 596, in send_event
    callback(event)
  File "/usr/src/homeassistant/homeassistant/components/sonos/speaker.py", line 418, in async_dispatch_event
    dispatcher = self._event_dispatchers[event.service.service_type]
KeyError: 'AlarmClock'

Other Sonos related log entries:

Logger: homeassistant.util.logging
Source: util/logging.py:114
First occurred: 07:24:44 (1 occurrences)
Last logged: 07:24:44

Exception in async_rebooted when dispatching 'sonos_rebooted-RINCON_38420B0F800C01400': (SoCo("192.168.40.217"),) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/sonos/speaker.py", line 592, in async_rebooted await self.async_offline() File "/usr/src/homeassistant/homeassistant/components/sonos/speaker.py", line 571, in async_offline async with self._subscription_lock: AttributeError: __aenter__
Logger: homeassistant.components.sonos.speaker
Source: components/sonos/speaker.py:312
Integration: Sonos ([documentation](https://www.home-assistant.io/integrations/sonos), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sonos%22))
First occurred: 07:23:27 (6 occurrences)
Last logged: 07:23:27

Creating subscription failed for Wohnzimmer: Request timed out
Logger: homeassistant.components.sonos.entity
Source: components/sonos/entity.py:79
Integration: Sonos ([documentation](https://www.home-assistant.io/integrations/sonos), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sonos%22))
First occurred: 07:23:26 (1 occurrences)
Last logged: 07:23:26

Wohnzimmer cannot reach None, falling back to polling, functionality may be limited, see https://www.home-assistant.io/integrations/sonos/#network-requirements for more details
Logger: homeassistant
Source: components/sonos/__init__.py:262
First occurred: 07:23:26 (1 occurrences)
Last logged: 07:23:26

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sonos/__init__.py", line 262, in _async_create_discovered_player
    await self.hass.async_add_executor_job(
asyncio.exceptions.TimeoutError

This is all from the time after one single reboot.

What version of Home Assistant Core has the issue?

core-2022.4.0

What was the last working version of Home Assistant Core?

core-2022.3.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Sonos

Link to integration documentation on our website

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

Diagnostics information

sonos-4406496d3e4fdc2ef91535963108bd75-Wohnzimmer-fb8604930be27b7755e7c9934d341447.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

sonos documentation sonos source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @cgtobi, @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)

jjlawren commented 2 years ago

Did this occur only the one time or are you able to reproduce the problem?

eikowagenknecht commented 2 years ago

It's been thrown 420 times in the last 24 hours (the "AlarmClock" error). Just rebooted HA and haven't seen it for ~30min. Will report back.

jjlawren commented 2 years ago

Has the problem recurred? It looks like it hit some unexpected race condition and failed, but it's not quite obvious where that might be.

eikowagenknecht commented 2 years ago

No, unfortunately it is silent ever since I rebooted.

jjlawren commented 2 years ago

I'd say that's good 😉

Let's close this for now, please reopen if it ever happens again.