{"record":{"id":"f130774e717a5603","repo":"home-assistant/core","slug":"entry-not-loaded","errorCode":"entry_not_loaded","errorMessage":"Entry not loaded: {entry}","messagePattern":"Entry not loaded: (.+?)","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/alexa_devices/services.py","lineNumber":63,"sourceCode":"    device_registry = dr.async_get(call.hass)\n    device_id = call.data[ATTR_DEVICE_ID]\n    if (\n        device_entry := device_registry.async_get(\n            device_id, include_child_devices=False\n        )\n    ) is None:\n        raise ServiceValidationError(\n            translation_domain=DOMAIN,\n            translation_key=\"invalid_device_id\",\n            translation_placeholders={\"device_id\": device_id},\n        )\n\n    for entry_id in device_entry.config_entries:\n        if (entry := call.hass.config_entries.async_get_entry(entry_id)) is None:\n            continue\n        if entry.domain == DOMAIN:\n            if entry.state is not ConfigEntryState.LOADED:\n                raise ServiceValidationError(\n                    translation_domain=DOMAIN,\n                    translation_key=\"entry_not_loaded\",\n                    translation_placeholders={\"entry\": entry.title},\n                )\n            return (device_entry, entry)\n\n    raise ServiceValidationError(\n        translation_domain=DOMAIN,\n        translation_key=\"config_entry_not_found\",\n        translation_placeholders={\"device_id\": device_id},\n    )\n\n\nasync def _async_execute_action(call: ServiceCall, attribute: str) -> None:\n    \"\"\"Execute action on the device.\"\"\"\n    device, config_entry = async_get_entry_id_for_service_call(call)\n    assert device.serial_number\n    value: str = call.data[attribute]","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/alexa_devices/services.py#L45-L81","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open Settings > Devices & Services and check the alexa_devices entry state; fix any setup error or complete reauth","Reload the alexa_devices integration and retry the service call","If the entry failed due to auth, complete the reauth flow first","In automations, guard against calling the service when the integration is not loaded (e.g. condition on integration state)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"entry = next(\n    (hass.config_entries.async_get_entry(e)\n     for e in device_entry.config_entries\n     if hass.config_entries.async_get_entry(e)\n     and hass.config_entries.async_get_entry(e).domain == DOMAIN),\n    None,\n)\nif entry is None or entry.state is not ConfigEntryState.LOADED:\n    _LOGGER.warning(\"alexa_devices entry not loaded; skipping service call\")\n    return","typeGuard":null,"tryCatchPattern":"try:\n    await hass.services.async_call(DOMAIN, SERVICE, service_data, blocking=True)\nexcept ServiceValidationError as err:\n    if err.translation_key == \"entry_not_loaded\":\n        _LOGGER.warning(\"Integration not loaded; reload it and retry\")","preventionTips":["Condition automations on the integration being loaded before calling its services","Avoid calling services during HA restart windows or integration reloads","Fix pending setup errors/reauth before depending on the services"],"tags":["alexa-devices","service-call","config-entry","lifecycle","homeassistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}