{"record":{"id":"c770676b6c798087","repo":"deepset-ai/haystack","slug":"component-named-name-not-found-in-the-pipeline","errorCode":null,"errorMessage":"Component named {name} not found in the pipeline.","messagePattern":"Component named (.+?) not found in the pipeline\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/core/pipeline/base.py","lineNumber":832,"sourceCode":"\n        return self\n\n    def get_component(self, name: str) -> Component:\n        \"\"\"\n        Get the component with the specified name from the pipeline.\n\n        :param name:\n            The name of the component.\n        :returns:\n            The instance of that component.\n\n        :raises ValueError:\n            If a component with that name is not present in the pipeline.\n        \"\"\"\n        try:\n            return self.graph.nodes[name][\"instance\"]\n        except KeyError as exc:\n            raise ValueError(f\"Component named {name} not found in the pipeline.\") from exc\n\n    def get_component_name(self, instance: Component) -> str:\n        \"\"\"\n        Returns the name of the Component instance if it has been added to this Pipeline or an empty string otherwise.\n\n        :param instance:\n            The Component instance to look for.\n        :returns:\n            The name of the Component instance.\n        \"\"\"\n        for name, inst in self.graph.nodes(data=\"instance\"):\n            if inst == instance:\n                return name\n        return \"\"\n\n    def inputs(self, include_components_with_connected_inputs: bool = False) -> dict[str, dict[str, Any]]:\n        \"\"\"\n        Returns a dictionary containing the inputs of a pipeline.","sourceCodeStart":814,"sourceCodeEnd":850,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/pipeline/base.py#L814-L850","documentation":"Pipeline.get_component() raises ValueError when no node with the given name exists in the pipeline graph; the underlying dict/graph KeyError is re-raised as ValueError. Called indirectly by remove_component(), which shares this lookup.","triggerScenarios":"pipeline.get_component('name') or pipeline.remove_component('name') with a name never added, a typo, or a component already removed.","commonSituations":"Typos in names; assuming default names instead of the ones given in add_component; removing a component twice; storing names in config files that drifted from code.","solutions":["List existing names first (pipeline.list_component_names() or pipeline.graph.nodes keys) and correct the name","Ensure the component is added with pipeline.add_component(name, ...) before get/remove","Check the exact spelling/case of the name"],"exampleFix":"// before\ncomp = pipeline.get_component('retrievr')\n// after\ncomp = pipeline.get_component('retriever')","handlingStrategy":"validation","validationCode":"names = pipeline.list_component_names()\nassert name in names, f\"{name!r} not in pipeline; available: {names}\"","typeGuard":"def component_exists(pipeline, name: str) -> bool:\n    return name in pipeline.list_component_names()","tryCatchPattern":"try:\n    comp = pipeline.get_component(name)\nexcept ValueError as e:\n    logger.error('%s; available: %s', e, pipeline.list_component_names())","preventionTips":["Keep component names in constants shared between add/get/remove call sites","Track removals so a component is never fetched after remove_component","Use pipeline.list_component_names() to verify before lookups"],"tags":["pipeline","haystack","missing-component","valueerror"],"backgroundTag":"pipeline-component-not-found","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}