{"record":{"id":"2572c55a7aa97397","repo":"home-assistant/core","slug":"updates-not-supported","errorCode":null,"errorMessage":"Updates not supported","messagePattern":"Updates not supported","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/application_credentials/__init__.py","lineNumber":108,"sourceCode":"        \"\"\"Validate the config is valid.\"\"\"\n        result = self.CREATE_SCHEMA(data)\n        domain = result[CONF_DOMAIN]\n        if not await _get_platform(self.hass, domain):\n            raise ValueError(f\"No application_credentials platform for {domain}\")\n        return result\n\n    @callback\n    @override\n    def _get_suggested_id(self, info: dict[str, str]) -> str:\n        \"\"\"Suggest an ID based on the config.\"\"\"\n        return f\"{info[CONF_DOMAIN]}.{info[CONF_CLIENT_ID]}\"\n\n    @override\n    async def _update_data(\n        self, item: dict[str, str], update_data: dict[str, str]\n    ) -> dict[str, str]:\n        \"\"\"Return a new updated data object.\"\"\"\n        raise ValueError(\"Updates not supported\")\n\n    @override\n    async def async_delete_item(self, item_id: str) -> None:\n        \"\"\"Delete item, verifying credential is not in use.\"\"\"\n        if item_id not in self.data:\n            raise collection.ItemNotFound(item_id)\n\n        # Cannot delete a credential currently in use by a ConfigEntry\n        current = self.data[item_id]\n        entries = self.hass.config_entries.async_entries(current[CONF_DOMAIN])\n        for entry in entries:\n            if entry.data.get(\"auth_implementation\") == item_id:\n                raise HomeAssistantError(\n                    f\"Cannot delete credential in use by integration {entry.domain}\"\n                )\n\n        await super().async_delete_item(item_id)\n","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/application_credentials/__init__.py#L90-L126","documentation":"Raised by ApplicationCredentialsStorageCollection._update_data whenever an update of a stored application credential is attempted. The application credentials storage collection deliberately implements an immutable item model: items are created and deleted but never updated, because the suggested id is derived from domain + client_id and mutating either would break linkage to config entries using auth_implementation.","triggerScenarios":"Any call that ends up in collection update flow for application credentials, e.g. a websocket application_credentials/update message or hass.services/collection API that routes to _update_data on the application_credentials storage collection.","commonSituations":"Scripts or custom frontends that try to rotate an OAuth client_id/client_secret in place; migrating an integration to a new OAuth app by editing the existing credential instead of deleting and recreating it.","solutions":["Delete the existing credential (application_credentials/delete) and create a new one with the updated client_id/secret, rather than updating it.","If the credential is referenced by a config entry (auth_implementation), remove or reconfigure that config entry first so the delete is not blocked by error 242.","Update your websocket/API client code to never send application_credentials/update — it is not a supported operation."],"exampleFix":"# before\nawait collection.async_update_item(item_id, {\"client_id\": new_id, \"client_secret\": new_secret})\n\n# after\nawait collection.async_delete_item(item_id)\nawait collection.async_create_item({\"domain\": domain, \"client_id\": new_id, \"client_secret\": new_secret})","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await collection.async_update_item(item_id, changes)\nexcept ValueError as err:\n    if \"Updates not supported\" in str(err):\n        await collection.async_delete_item(item_id)\n        await collection.async_create_item({**base_data, **changes})","preventionTips":["Never call update on the application_credentials collection; it is create/delete only.","When rotating client secrets, script delete-then-create as a single routine.","Check for config entries referencing the credential before deleting (see error 242)."],"tags":["home-assistant","application-credentials","immutable","websocket-api"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}