{"record":{"id":"807dba2f60ac45e4","repo":"home-assistant/core","slug":"result","errorCode":null,"errorMessage":"{result}","messagePattern":"\\{result\\}","errorType":"exception","errorClass":"BackupManagerError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/backup/manager.py","lineNumber":651,"sourceCode":"                    manager_state=self.state,\n                    agent_id=agent_id,\n                    uploaded_bytes=_backup.size,\n                    total_bytes=_backup.size,\n                )\n            )\n            if streamer:\n                await streamer.wait()\n\n        sync_backup_results = await asyncio.gather(\n            *(upload_backup_to_agent(agent_id) for agent_id in agent_ids),\n            return_exceptions=True,\n        )\n        for idx, result in enumerate(sync_backup_results):\n            agent_id = agent_ids[idx]\n            if isinstance(result, BackupReaderWriterError):\n                # writer errors will affect all agents\n                # no point in continuing\n                raise BackupManagerError(str(result)) from result\n            if isinstance(result, BackupAgentError):\n                agent_errors[agent_id] = result\n                LOGGER.error(\"Upload failed for %s: %s\", agent_id, result)\n                continue\n            if isinstance(result, Exception):\n                # trap bugs from agents\n                agent_errors[agent_id] = result\n                LOGGER.error(\n                    \"Unexpected error for %s: %s\", agent_id, result, exc_info=result\n                )\n                continue\n            if isinstance(result, BaseException):\n                raise result\n\n        return agent_errors\n\n    async def async_get_backups(\n        self,","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/backup/manager.py#L633-L669","documentation":"Raised while syncing a newly generated backup to agents: if any agent's upload raises BackupReaderWriterError, the manager immediately aborts the whole sync by raising BackupManagerError(str(result)). BackupReaderWriterError comes from the local reader/writer side (the thing that reads the backup file from disk and streams it to agents), so its failure affects every agent — e.g., the backup file vanished or could not be read mid-upload.","triggerScenarios":"During _async_finish_backup upload phase: the local backup file was deleted, moved, or became unreadable while uploads were streaming; disk I/O error on the backup directory; the reader failed to open/seek the tar file for one of the agents.","commonSituations":"Backup directory on flaky external storage; an automation or user deleting the fresh backup file while it is still uploading; disk full or filesystem errors during a large backup upload.","solutions":["Check that the backup file still exists in the backup directory and the disk/filesystem is healthy (df, dmesg for I/O errors).","Ensure nothing (cleanup automations, scripts) deletes from the backup directory during the upload window.","Free disk space if the volume is full; retry the backup afterwards.","Look at the agent upload log lines ('Upload failed for ...') just before the raise for the underlying reader/writer detail."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"backup_path = manager.get_backup_path(backup_id)\nexists, free = await asyncio.gather(\n    hass.async_add_executor_job(backup_path.exists),\n    hass.async_add_executor_job(shutil.disk_usage, backup_path.anchor),\n)\nif not exists or free.free < expected_size:\n    LOGGER.warning(\"aborting sync: file missing or disk low\")","typeGuard":null,"tryCatchPattern":"from homeassistant.components.backup.manager import BackupManagerError\n\ntry:\n    await finish_task\nexcept BackupManagerError as err:\n    LOGGER.error(\"agent sync failed (reader/writer): %s\", err)\n    await verify_backup_file_intact()","preventionTips":["Ensure ample free disk space before large backups.","Never delete from the backup directory while a backup is uploading.","Monitor backup-directory disk health/mounts."],"tags":["backup","upload","reader-writer","disk"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}