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.9k stars 30.97k forks source link

Bring: Exceptions when a list got deleted #129976

Open ReneNulschDE opened 2 weeks ago

ReneNulschDE commented 2 weeks ago

The problem

After I delete a list in the bring app an exception is thrown in each update cycle (90sec).

Steps:

  1. Create a list
  2. Reload the component
  3. Check that the list exists in HA
  4. Delete the list in the app

Current result: A KeyError exception occurs. (Details see below)

Expected result: The deletion is recognized and the sensors/actions are unloaded without an exception.

Workaround: Reload the component

What version of Home Assistant Core has the issue?

2024.12.0.dev0

What was the last working version of Home Assistant Core?

n/a

What type of installation are you running?

Home Assistant Core

Integration causing the issue

bring

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-11-06 21:28:41.168 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/home/rene/repo/core/homeassistant/helpers/update_coordinator.py", line 266, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/home/rene/repo/core/homeassistant/helpers/update_coordinator.py", line 481, in _async_refresh
    self.async_update_listeners()
  File "/home/rene/repo/core/homeassistant/helpers/update_coordinator.py", line 176, in async_update_listeners
    update_callback()
  File "/home/rene/repo/core/homeassistant/helpers/update_coordinator.py", line 561, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/home/rene/repo/core/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/home/rene/repo/core/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    self.__async_calculate_state()
  File "/home/rene/repo/core/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rene/repo/core/homeassistant/helpers/entity.py", line 1013, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/home/rene/repo/core/homeassistant/components/sensor/__init__.py", line 544, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/home/rene/repo/core/homeassistant/components/bring/sensor.py", line 128, in native_value
    self.coordinator.data[self._list_uuid],
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: '4c137db6-5a7e-4d7a-93c9-xxx'

Additional information

No response

home-assistant[bot] commented 2 weeks ago

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

Code owner commands Code owners of `bring` 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 bring` 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)


bring documentation bring source (message by IssueLinks)

tr4nt0r commented 2 weeks ago

Does it go away if you reload the integration?

ReneNulschDE commented 2 weeks ago

Yes, as stated in the workaround.