{"record":{"id":"ec9e08be54495667","repo":"home-assistant/core","slug":"backup-backup-id-not-found-ec9e08","errorCode":null,"errorMessage":"Backup {backup_id} not found","messagePattern":"Backup (.+?) not found","errorType":"exception","errorClass":"BackupNotFound","httpStatus":null,"severity":"error","filePath":"homeassistant/components/backup/backup.py","lineNumber":106,"sourceCode":"    @override\n    async def async_list_backups(self, **kwargs: Any) -> list[AgentBackup]:\n        \"\"\"List backups.\"\"\"\n        if not self._loaded_backups:\n            await self._load_backups()\n        return [backup for backup, _ in self._backups.values()]\n\n    @override\n    async def async_get_backup(\n        self,\n        backup_id: str,\n        **kwargs: Any,\n    ) -> AgentBackup:\n        \"\"\"Return a backup.\"\"\"\n        if not self._loaded_backups:\n            await self._load_backups()\n\n        if backup_id not in self._backups:\n            raise BackupNotFound(f\"Backup {backup_id} not found\")\n\n        backup, backup_path = self._backups[backup_id]\n        if not await self._hass.async_add_executor_job(backup_path.exists):\n            LOGGER.debug(\n                (\n                    \"Removing tracked backup (%s) that does not exists on the expected\"\n                    \" path %s\"\n                ),\n                backup.backup_id,\n                backup_path,\n            )\n            self._backups.pop(backup_id)\n            raise BackupNotFound(f\"Backup {backup_id} not found\")\n\n        return backup\n\n    @override\n    def get_backup_path(self, backup_id: str) -> Path:","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/backup/backup.py#L88-L124","documentation":"Raised by the local backup agent (LocalBackupAgent, the 'backup.local' agent) when async_get_backup is asked for a backup_id that is not in the in-memory _backups map after the backup directory has been (re)loaded. The agent lazily loads the backup directory on first call, so the error means no backup with that ID is tracked locally.","triggerScenarios":"Calling async_get_backup(backup_id) with an ID that does not correspond to any tar file previously seen in the local backup directory; the backup directory was moved or wiped (fresh install, /backups volume not mounted on HAOS); the ID belongs to a remote-agent-only backup.","commonSituations":"Restoring or inspecting a backup after the storage mount holding /backups was lost; a fresh Home Assistant OS install with old backup records in the UI; passing an agent-reported ID from a different agent (e.g., a cloud agent's ID) to the local agent.","solutions":["Confirm the backup file still exists in the backup directory (default /backups on HAOS) and the mount is healthy.","Reload the backup integration or restart Home Assistant so the local agent rescans the directory.","Use the correct agent_id: check the backup's agents via the manager so the ID is looked up against the agent that actually holds it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"backups = await local_agent.async_list_backups()\nif backup_id not in {b.backup_id for b in backups}:\n    raise ValueError(f\"unknown backup {backup_id}\")","typeGuard":null,"tryCatchPattern":"from homeassistant.components.backup.agent import BackupNotFound\n\ntry:\n    backup = await local_agent.async_get_backup(backup_id)\nexcept BackupNotFound:\n    LOGGER.warning(\"Local backup %s missing\", backup_id)\n    await trigger_list_refresh()","preventionTips":["List local backups before referencing an ID captured earlier.","Keep the /backups mount stable; monitor disk mounts.","Route lookups through the manager, which knows which agent holds which backup."],"tags":["backup","local-agent","not-found","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}