home-assistant/core · error · HomeAssistantError
Could not find To-do item
Error message
Could not find To-do item
What it means
HomeAssistantError raised in async_delete_todo_items when asyncio.gather over todo_by_uid lookups raises NotFoundError — at least one requested uid does not exist on the server. The whole delete operation aborts (the gather fails fast), so no items are removed.
Source
Thrown at homeassistant/components/caldav/todo.py:194
),
)
# 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_delete_todo_items(self, uids: list[str]) -> None:
"""Delete To-do items."""
tasks = (
self.hass.async_add_executor_job(self._calendar.todo_by_uid, uid)
for uid in uids
)
try:
items = await asyncio.gather(*tasks)
except NotFoundError as err:
raise HomeAssistantError("Could not find To-do item") from err
except (requests.ConnectionError, requests.Timeout, DAVError) as err:
raise HomeAssistantError(f"CalDAV lookup error: {err}") from err
# Run serially as some CalDAV servers do not support concurrent modifications
for item in items:
try:
await self.hass.async_add_executor_job(item.delete)
except (requests.ConnectionError, requests.Timeout, DAVError) as err:
raise HomeAssistantError(f"CalDAV delete error: {err}") from err
# refreshing async otherwise it would take too much time
self.hass.async_create_task(self.async_update_ha_state(force_refresh=True))
View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Refresh the entity's item list before issuing deletes so uids reflect server state
- Delete items one-by-one (or re-select after refresh) so a single stale uid does not abort the batch
- If writing automations, resolve uids dynamically from todo.get_items rather than hardcoding them
Defensive patterns
Strategy: validation
Validate before calling
# Resolve uids fresh before a batch delete
items = await self.coordinator.async_get_items() # or todo.get_items service
live_uids = {i.uid for i in items}
uids = [u for u in requested_uids if u in live_uids] Try / catch
except NotFoundError as err:
raise HomeAssistantError("Could not find To-do item") from err Prevention
- Refresh the list immediately before multi-select deletes
- Filter stale uids out of batch requests so one missing item cannot abort all
- In automations, always look up uids from current entity state
When it happens
Trigger: Calling todo.remove_item / todo.set_value with uids where any one uid was already deleted server-side (multi-select delete after a stale UI list, or another client removed items concurrently).
Common situations: Stale to-do list in the HA UI after edits on phone/webmail; scripts deleting by hardcoded uid; server-side auto-clean of completed tasks.
Related errors
- Could not find To-do item {uid}
- CalDAV save error: {err}
- CalDAV lookup error: {err}
- CalDAV delete error: {err}
- Credentials error from CalDAV server
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/1de3f1d949842910.
Report an issue: GitHub.