home-assistant/core · error · ServiceValidationError

entry_not_loaded

entry_not_loaded

Error message

Entry not loaded: {entry}

What it means

ServiceValidationError with translation key alexa_devices/entry_not_loaded, raised when the device exists and belongs to an alexa_devices config entry, but that entry's state is not ConfigEntryState.LOADED (e.g. NOT_LOADED, SETUP_ERROR, MIGRATION_ERROR, FAILED_SETUP). The service cannot run because no runtime coordinator is available.

Source

Thrown at homeassistant/components/alexa_devices/services.py:63

    device_registry = dr.async_get(call.hass)
    device_id = call.data[ATTR_DEVICE_ID]
    if (
        device_entry := device_registry.async_get(
            device_id, include_child_devices=False
        )
    ) is None:
        raise ServiceValidationError(
            translation_domain=DOMAIN,
            translation_key="invalid_device_id",
            translation_placeholders={"device_id": device_id},
        )

    for entry_id in device_entry.config_entries:
        if (entry := call.hass.config_entries.async_get_entry(entry_id)) is None:
            continue
        if entry.domain == DOMAIN:
            if entry.state is not ConfigEntryState.LOADED:
                raise ServiceValidationError(
                    translation_domain=DOMAIN,
                    translation_key="entry_not_loaded",
                    translation_placeholders={"entry": entry.title},
                )
            return (device_entry, entry)

    raise ServiceValidationError(
        translation_domain=DOMAIN,
        translation_key="config_entry_not_found",
        translation_placeholders={"device_id": device_id},
    )


async def _async_execute_action(call: ServiceCall, attribute: str) -> None:
    """Execute action on the device."""
    device, config_entry = async_get_entry_id_for_service_call(call)
    assert device.serial_number
    value: str = call.data[attribute]

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Open Settings > Devices & Services and check the alexa_devices entry state; fix any setup error or complete reauth
  2. Reload the alexa_devices integration and retry the service call
  3. If the entry failed due to auth, complete the reauth flow first
  4. In automations, guard against calling the service when the integration is not loaded (e.g. condition on integration state)
Defensive patterns

Strategy: validation

Validate before calling

entry = next(
    (hass.config_entries.async_get_entry(e)
     for e in device_entry.config_entries
     if hass.config_entries.async_get_entry(e)
     and hass.config_entries.async_get_entry(e).domain == DOMAIN),
    None,
)
if entry is None or entry.state is not ConfigEntryState.LOADED:
    _LOGGER.warning("alexa_devices entry not loaded; skipping service call")
    return

Try / catch

try:
    await hass.services.async_call(DOMAIN, SERVICE, service_data, blocking=True)
except ServiceValidationError as err:
    if err.translation_key == "entry_not_loaded":
        _LOGGER.warning("Integration not loaded; reload it and retry")

Prevention

When it happens

Trigger: Calling an alexa_devices service for a device whose config entry failed setup (auth failure, connection failure) or was unloaded/reloaded — device_entry.config_entries contains an alexa_devices entry with state != LOADED.

Common situations: Service call raced with a reload/restart, the entry entered SETUP_RETRY after a network outage, or reauth is pending after cookie expiry so the entry is not loaded.

Related errors


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