{"record":{"id":"81cca81592a3ba74","repo":"deepset-ai/haystack","slug":"there-is-no-component-named-name-in-the-pipeli","errorCode":null,"errorMessage":"There is no component named '{name}' in the pipeline. The valid component names are: ","messagePattern":"There is no component named '(.+?)' in the pipeline\\. The valid component names are: ","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/core/pipeline/base.py","lineNumber":546,"sourceCode":"        Remove and returns component from the pipeline.\n\n        Remove an existing component from the pipeline by providing its name.\n        All edges that connect to the component will also be deleted.\n\n        :param name:\n            The name of the component to remove.\n        :returns:\n            The removed Component instance.\n\n        :raises ValueError:\n            If there is no component with that name already in the Pipeline.\n        \"\"\"\n\n        # Check that a component with that name is in the Pipeline\n        try:\n            instance = self.get_component(name)\n        except ValueError as exc:\n            raise ValueError(\n                f\"There is no component named '{name}' in the pipeline. The valid component names are: \",\n                \", \".join(n for n in self.graph.nodes),\n            ) from exc\n\n        # Remove this component's name from its neighbors' sockets before the edges are gone,\n        # otherwise the surviving components are left holding dangling references to it.\n        for _, _, edge_data in self.graph.in_edges(name, data=True):\n            sender_socket = edge_data[\"from_socket\"]\n            sender_socket.receivers = [r for r in sender_socket.receivers if r != name]\n        for _, _, edge_data in self.graph.out_edges(name, data=True):\n            receiver_socket = edge_data[\"to_socket\"]\n            receiver_socket.senders = [s for s in receiver_socket.senders if s != name]\n            if (\n                len(receiver_socket.senders) <= 1\n                and receiver_socket.is_lazy_variadic\n                and not receiver_socket.wrap_input_in_list\n            ):\n                receiver_socket.is_lazy_variadic = False","sourceCodeStart":528,"sourceCodeEnd":564,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/pipeline/base.py#L528-L564","documentation":"remove_component(name) first looks the component up via get_component; if no node with that name exists, the underlying ValueError is re-raised with a message listing the valid component names so the caller can correct the name.","triggerScenarios":"pipe.remove_component(\"retriever\") when the component was registered under a different name; a typo or case mismatch ('Retriever' vs 'retriever'); removing a component that was already removed.","commonSituations":"Refactors renaming components without updating removal/teardown code; dynamic pipelines where names are generated; notebooks where the pipeline was rebuilt with different names.","solutions":["Check pipe.graph.nodes (or walk the pipeline) for the exact registered name and use it","Read the valid names listed in the error message and fix the typo/case","Guard with `if name in pipe.graph.nodes: pipe.remove_component(name)` before calling"],"exampleFix":"// before\npipe.remove_component(\"Retriever\")  # wrong case\n// after\nif \"retriever\" in pipe.graph.nodes:\n    pipe.remove_component(\"retriever\")","handlingStrategy":"validation","validationCode":"def safe_remove(pipe, name: str) -> None:\n    if name in pipe.graph.nodes:\n        pipe.remove_component(name)","typeGuard":"def component_exists(pipe, name: str) -> bool:\n    return name in pipe.graph.nodes","tryCatchPattern":"try:\n    pipe.remove_component(name)\nexcept ValueError as e:\n    if \"no component named\" in str(e):\n        logger.warning(\"Skipping removal, %s not in pipeline\", name)\n    else:\n        raise","preventionTips":["Keep component names in constants shared by add/remove/connect code","Parse the valid names listed in the error message when debugging","Guard removals with `name in pipe.graph.nodes`"],"tags":["python","pipeline","api-misuse"],"backgroundTag":"unknown-identifier","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}