{"record":{"id":"2f8b118a7dcc9e63","repo":"home-assistant/core","slug":"blueprint-in-use","errorCode":null,"errorMessage":"Blueprint in use","messagePattern":"Blueprint in use","errorType":"exception","errorClass":"BlueprintInUse","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/blueprint/models.py","lineNumber":327,"sourceCode":"    ) -> BlueprintInputs:\n        \"\"\"Process a blueprint config.\"\"\"\n        try:\n            config_with_blueprint = BLUEPRINT_INSTANCE_FIELDS(config_with_blueprint)\n        except vol.Invalid as err:\n            raise InvalidBlueprintInputs(\n                self.domain, humanize_error(config_with_blueprint, err)\n            ) from err\n\n        bp_conf = config_with_blueprint[CONF_USE_BLUEPRINT]\n        blueprint = await self.async_get_blueprint(bp_conf[CONF_PATH])\n        inputs = BlueprintInputs(blueprint, config_with_blueprint)\n        inputs.validate()\n        return inputs\n\n    async def async_remove_blueprint(self, blueprint_path: str) -> None:\n        \"\"\"Remove a blueprint file.\"\"\"\n        if self._blueprint_in_use(self.hass, blueprint_path):\n            raise BlueprintInUse(self.domain, blueprint_path)\n        path = self.blueprint_folder / blueprint_path\n        await self.hass.async_add_executor_job(path.unlink)\n        self._blueprints[blueprint_path] = None\n\n    def _create_file(\n        self, blueprint: Blueprint, blueprint_path: str, allow_override: bool\n    ) -> bool:\n        \"\"\"Create blueprint file.\n\n        Returns true if the action overrides an existing blueprint.\n        \"\"\"\n\n        path = pathlib.Path(\n            self.hass.config.path(BLUEPRINT_FOLDER, self.domain, blueprint_path)\n        )\n        exists = path.exists()\n\n        if not allow_override and exists:","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/blueprint/models.py#L309-L345","documentation":"BlueprintInUse is raised by async_remove_blueprint when the manager detects the blueprint path is still referenced by an active automation or script (via _blueprint_in_use). Deletion is refused to avoid leaving consumers pointing at a missing file.","triggerScenarios":"Calling the bluetooth-style delete path — i.e. the blueprint/delete or blueprint/import websocket with delete-first semantics, or async_remove_blueprint — while at least one automation/script config contains use_blueprint.path equal to this blueprint.","commonSituations":"User tries to delete a blueprint from the UI without first removing the automations built from it; automations in a disabled state still count as references.","solutions":["Find and delete (or re-point) every automation/script using the blueprint — the blueprint's UI page lists its 'usages'","Then retry the delete","Alternatively keep the blueprint; the error is intentional protection, not corruption"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from homeassistant.components.blueprint.errors import BlueprintInUse\ntry:\n    await manager.async_remove_blueprint(path)\nexcept BlueprintInUse:\n    # list usages and ask the user to delete/re-point them first","preventionTips":["Check the blueprint's 'usages' list in the UI before deleting","Automate cleanup: remove consuming automations in the same script that deletes the blueprint"],"tags":["blueprint","delete","in-use"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}