{"record":{"id":"fa52567e5dc34c66","repo":"home-assistant/core","slug":"config-entry-not-loaded","errorCode":"config_entry_not_loaded","errorMessage":"Config entry not loaded.","messagePattern":"Config entry not loaded\\.","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/adguard/__init__.py","lineNumber":69,"sourceCode":"\n@dataclass\nclass AdGuardData:\n    \"\"\"Adguard data type.\"\"\"\n\n    client: AdGuardHome\n    version: str\n\n\nasync def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:\n    \"\"\"Set up the component.\"\"\"\n\n    def _get_adguard_instances(hass: HomeAssistant) -> list[AdGuardHome]:\n        \"\"\"Get the AdGuardHome instances.\"\"\"\n        entries: list[AdGuardConfigEntry] = hass.config_entries.async_loaded_entries(\n            DOMAIN\n        )\n        if not entries:\n            raise ServiceValidationError(\n                translation_domain=DOMAIN, translation_key=\"config_entry_not_loaded\"\n            )\n        return [entry.runtime_data.client for entry in entries]\n\n    async def add_url(call: ServiceCall) -> None:\n        \"\"\"Service call to add a new filter subscription to AdGuard Home.\"\"\"\n        for adguard in _get_adguard_instances(call.hass):\n            await adguard.filtering.add_url(\n                allowlist=False, name=call.data[CONF_NAME], url=call.data[CONF_URL]\n            )\n\n    async def remove_url(call: ServiceCall) -> None:\n        \"\"\"Service call to remove a filter subscription from AdGuard Home.\"\"\"\n        for adguard in _get_adguard_instances(call.hass):\n            await adguard.filtering.remove_url(allowlist=False, url=call.data[CONF_URL])\n\n    async def enable_url(call: ServiceCall) -> None:\n        \"\"\"Service call to enable a filter subscription in AdGuard Home.\"\"\"","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/adguard/__init__.py#L51-L87","documentation":"ServiceValidationError with translation_key config_entry_not_loaded, raised by adguard's _get_adguard_instances helper when a domain service (add_url, remove_url, etc.) is invoked but hass.config_entries.async_loaded_entries(DOMAIN) returns nothing. It signals user-facing misconfiguration: the service exists but no AdGuard Home config entry is currently loaded to act on.","triggerScenarios":"Calling adguard.add_url / adguard.remove_url (or any adguard service registered in async_setup) while the integration has no loaded entries — entry disabled, failed to set up, was removed, or Home Assistant is still starting and the entry has not initialized yet.","commonSituations":"User disabled the AdGuard Home integration but kept automations calling its services; entry in a retry/failed state after AdGuard server outage; service called during startup before async_setup_entry completes; entry removed but stale automations/scripts remain.","solutions":["Open Settings > Devices & Services and confirm the AdGuard Home entry exists, is enabled, and shows as Loaded (no setup errors).","Reload the AdGuard Home entry (or restart Home Assistant) if it is in a failed/retry state, then retry the service call.","Fix connectivity to the AdGuard Home host/port and credentials if entry setup keeps failing — that is the root cause of the entry not being loaded.","Remove or guard automations/scripts that call adguard services so they only run when the integration is active (e.g. condition on integration state)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"def adguard_ready(hass: HomeAssistant) -> bool:\n    \"\"\"True when at least one AdGuard entry is loaded and services can act.\"\"\"\n    return bool(hass.config_entries.async_loaded_entries(DOMAIN))","typeGuard":null,"tryCatchPattern":"from homeassistant.exceptions import ServiceValidationError\n\ntry:\n    await hass.services.async_call(\"adguard\", \"add_url\", service_data)\nexcept ServiceValidationError as err:\n    # no loaded AdGuard entry: fix integration state, not the service call\n    _LOGGER.warning(\"AdGuard service skipped: %s\", err)","preventionTips":["Condition automations on the AdGuard integration being loaded (e.g. integration state sensor or template on config entries).","Do not disable an integration while leaving its service-calling automations enabled.","After removing an entry, grep automations/scripts for its service calls."],"tags":["homeassistant","adguard","service-validation","config-entry"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}