home-assistant/core · error · HomeAssistantError

Could not find To-do item {uid}

Error message

Could not find To-do item {uid}

What it means

HomeAssistantError raised in async_update_todo_item when todo_by_uid raises NotFoundError — the server has no VTODO with the given UID. Usually the item was deleted server-side (or from another client) after the HA list was last refreshed.

Source

Thrown at homeassistant/components/caldav/todo.py:155

        try:
            await self.hass.async_add_executor_job(
                partial(self._calendar.save_todo, **item_data),
            )
            # refreshing async otherwise it would take too much time
            self.hass.async_create_task(self.async_update_ha_state(force_refresh=True))
        except (requests.ConnectionError, requests.Timeout, DAVError) as err:
            raise HomeAssistantError(f"CalDAV save error: {err}") from err

    @override
    async def async_update_todo_item(self, item: TodoItem) -> None:
        """Update a To-do item."""
        uid: str = cast(str, item.uid)
        try:
            todo = await self.hass.async_add_executor_job(
                self._calendar.todo_by_uid, uid
            )
        except NotFoundError as err:
            raise HomeAssistantError(f"Could not find To-do item {uid}") from err
        except (requests.ConnectionError, requests.Timeout, DAVError) as err:
            raise HomeAssistantError(f"CalDAV lookup error: {err}") from err
        vtodo = todo.icalendar_component  # type: ignore[attr-defined]
        vtodo["SUMMARY"] = item.summary or ""
        if status := item.status:
            vtodo["STATUS"] = TODO_STATUS_MAP_INV.get(status, "NEEDS-ACTION")
        if due := item.due:
            todo.set_due(due)  # type: ignore[attr-defined]
        else:
            vtodo.pop("DUE", None)
        if description := item.description:
            vtodo["DESCRIPTION"] = description
        else:
            vtodo.pop("DESCRIPTION", None)
        try:
            await self.hass.async_add_executor_job(
                partial(
                    todo.save,

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Refresh the to-do list entity (call todo/get_items or wait for the next coordinator update) and retry against an existing uid
  2. Delete and recreate the item if the update is important and the original is gone server-side
  3. Check the server-side trash/auto-purge settings if items keep disappearing unexpectedly
Defensive patterns

Strategy: try-catch

Validate before calling

uid = item.uid
items = {t.uid for t in (self.coordinator.data.items if self.coordinator.data else [])}
if uid not in items:
    # refresh or skip instead of hitting NotFoundError

Try / catch

except NotFoundError as err:
    raise HomeAssistantError(f"Could not find To-do item {uid}") from err

Prevention

When it happens

Trigger: Calling todo.update_item with a uid that no longer exists on the CalDAV server: concurrent modification, deletion in the native calendar app, or a stale local cache after the server pruned old completed items.

Common situations: User deletes a task on their phone while HA still shows it; servers auto-purging completed tasks; calendar shared and edited by multiple clients.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/768ba937c3cd14b6. Report an issue: GitHub.