home-assistant/core · error · BackupManagerError

Cannot include all addons and specify specific addons

Error message

Cannot include all addons and specify specific addons

What it means

Raised by BackupManager.async_create_backup when the request sets both include_all_addons=True and a non-empty include_addons list. The two options are mutually exclusive: either back up every addon or an explicit list — the manager refuses to guess the union.

Source

Thrown at homeassistant/components/backup/manager.py:1186

        unavailable_agents = [
            agent_id for agent_id in agent_ids if agent_id not in self.backup_agents
        ]
        if not (
            available_agents := [
                agent_id for agent_id in agent_ids if agent_id in self.backup_agents
            ]
        ):
            raise BackupManagerError(
                f"At least one available backup agent must be selected, got {agent_ids}"
            )
        if unavailable_agents:
            LOGGER.warning(
                "Backup agents %s are not available, will backup to %s",
                unavailable_agents,
                available_agents,
            )
        if include_all_addons and include_addons:
            raise BackupManagerError(
                "Cannot include all addons and specify specific addons"
            )

        kind = "Automatic" if with_automatic_settings else "Custom"
        backup_name = (
            name if name is None else name.strip()
        ) or f"{kind} backup {HAVERSION}"
        extra_metadata = extra_metadata or {}

        try:
            (
                new_backup,
                self._backup_task,
            ) = await self._reader_writer.async_create_backup(
                agent_ids=available_agents,
                backup_name=backup_name,
                extra_metadata=extra_metadata
                | {

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Pick one: either include_all_addons=True with include_addons=None/omitted, or include_all_addons=False/omitted with the explicit list.
  2. Build the request kwargs conditionally instead of passing every field unconditionally.
  3. Update API clients to the current backup websocket schema (fields should be omitted, not defaulted).

Example fix

# before
await manager.async_create_backup(
    include_all_addons=True,
    include_addons=["core_mosquitto"],  # conflict
    ...,
)

# after
await manager.async_create_backup(
    include_all_addons=True,
    ...,
)  # include_addons omitted
Defensive patterns

Strategy: validation

Validate before calling

if include_all_addons and include_addons:
    raise ValueError("choose either include_all_addons or include_addons")

Try / catch

from homeassistant.components.backup.manager import BackupManagerError

try:
    await manager.async_create_backup(
        include_all_addons=include_all_addons,
        include_addons=None if include_all_addons else include_addons,
        ...,
    )
except BackupManagerError as err:
    if "Cannot include all addons" in str(err):
        # fix request and retry once
        ...
    raise

Prevention

When it happens

Trigger: Calling async_create_backup (or the websocket create-backup service) with include_all_addons=True and include_addons=["addon_slug", ...]; typically a UI/client bug that sends both fields with their defaults rather than omitting one.

Common situations: Custom scripts or API clients copying a full parameter dict and flipping include_all_addons without clearing include_addons; frontend bugs after API changes.

Related errors


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