Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unhandled Notion exception when task_id is missing #43327

@bachya

Description

@bachya

The problem

Notion is returning an unhandled exception when the API fails to return data for an existing "task" (stacktrace below).

Environment

  • Home Assistant Core release with the issue: 0.118.0b3
  • Last working Home Assistant Core release (if known): ?
  • Operating environment (OS/Container/Supervised/Core): Container
  • Integration causing this issue: Notion
  • Link to integration documentation on our website: https://home-assistant.io/integrations/notion

Problem-relevant configuration.yaml

Traceback/Error logs

Logger: homeassistant
Source: components/notion/binary_sensor.py:80 
First occurred: 12:11:55 PM (20 occurrences) 
Last logged: 12:30:55 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 119, in _handle_refresh_interval
    await self.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 193, in async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/components/notion/__init__.py", line 253, in _handle_coordinator_update
    self._async_update_from_latest_data()
  File "/usr/src/homeassistant/homeassistant/components/notion/binary_sensor.py", line 80, in _async_update_from_latest_data
    task = self.coordinator.data["tasks"][self._task_id]
KeyError: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

Additional information

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions