home-assistant/core · error · BackupReaderWriterError
Home Assistant must be included in backup
Error message
Home Assistant must be included in backup
What it means
BackupReaderWriterError raised when creating a core backup with include_homeassistant=False. The core backup format is the Home Assistant configuration directory archive; a core backup that excludes Home Assistant itself would be empty, so HA rejects it.
Source
Thrown at homeassistant/components/backup/manager.py:1739
extra_metadata: dict[str, bool | str],
include_addons: list[str] | None,
include_all_addons: bool,
include_database: bool,
include_folders: list[Folder] | None,
include_homeassistant: bool,
on_progress: Callable[[CreateBackupEvent], None],
password: str | None,
) -> tuple[NewBackup, asyncio.Task[WrittenBackup]]:
"""Initiate generating a backup."""
date_str = dt_util.now().isoformat()
backup_id = _generate_backup_id(date_str, backup_name)
if include_addons or include_all_addons or include_folders:
raise BackupReaderWriterError(
"Addons and folders are not supported by core backup"
)
if not include_homeassistant:
raise BackupReaderWriterError("Home Assistant must be included in backup")
backup_task = self._hass.async_create_task(
self._async_create_backup(
agent_ids=agent_ids,
backup_id=backup_id,
backup_name=backup_name,
extra_metadata=extra_metadata,
include_database=include_database,
date_str=date_str,
on_progress=on_progress,
password=password,
),
name="backup_manager_create_backup",
eager_start=False, # To ensure the task is not started before we return
)
return (NewBackup(backup_job_id=backup_id), backup_task)
View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Always pass include_homeassistant=True for core backups
- If you only wanted to trigger an agent-side backup, use the agent's own API rather than the core create flow
- Audit the create-backup payload construction to stop forwarding unsupported combinations
Example fix
// before
{"include_homeassistant": false, "include_database": true}
// after
{"include_homeassistant": true, "include_database": true} Defensive patterns
Strategy: validation
Validate before calling
assert include_homeassistant, "Core backups must include Home Assistant"
Prevention
- Never forward include_homeassistant=false to the core create flow
- Validate the payload client-side: reject empty backup requests
- Treat include_homeassistant as mandatory in any core-backup helper you write
When it happens
Trigger: Calling the core backup creation API with include_homeassistant set to False (while the addon/folder flags are already clean).
Common situations: A client forwards a full backup-options form and passes include_homeassistant: false; script built for agent-only backups assumes the flag is honored; UI payload built by concatenating optional flags defaults wrongly.
Related errors
- Addons and folders are not supported by core backup
- username_not_normalized
- You need at least Home Assistant version {backup_meta_versio
- Operation mode not supported
- Command not found. Exiting sequence
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/235bf8545880b82e.
Report an issue: GitHub.