{"record":{"id":"a92737af091a8051","repo":"deepset-ai/haystack","slug":"name-is-an-invalid-component-name-cannot-contai","errorCode":null,"errorMessage":"{name} is an invalid component name, cannot contain '.' (dot) characters.","messagePattern":"(.+?) is an invalid component name, cannot contain '\\.' \\(dot\\) characters\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/core/pipeline/base.py","lineNumber":486,"sourceCode":"            self._add_component_to_graph(name, instance)\n\n        return self\n\n    def _validate_component(self, name: str, instance: Component) -> bool:\n        \"\"\"Validate a component before adding it, returning whether it needs to be added.\"\"\"\n        # Component names are unique\n        if name in self.graph.nodes:\n            if self.graph.nodes[name][\"instance\"] is instance:\n                return False\n            raise ValueError(f\"A component named '{name}' already exists in this pipeline: choose another name.\")\n\n        # Components can't be named `_debug`\n        if name == \"_debug\":\n            raise ValueError(\"'_debug' is a reserved name for debug output. Choose another name.\")\n\n        # Component names can't have \".\"\n        if \".\" in name:\n            raise ValueError(f\"{name} is an invalid component name, cannot contain '.' (dot) characters.\")\n\n        # Component instances must be components\n        if not isinstance(instance, Component):\n            raise PipelineValidationError(\n                f\"'{type(instance)}' doesn't seem to be a component. Is this class decorated with @component?\"\n            )\n\n        if owning_pipeline := getattr(instance, \"__haystack_added_to_pipeline__\", None):\n            if owning_pipeline is self:\n                existing_name = self.get_component_name(instance)\n                msg = (\n                    f\"Component has already been added to this Pipeline under the name '{existing_name}'. \"\n                    \"A component instance can only be added once.\"\n                )\n            else:\n                msg = (\n                    \"Component has already been added in another Pipeline. \"\n                    \"Components can't be shared between Pipelines. Create a new instance instead.\"","sourceCodeStart":468,"sourceCodeEnd":504,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/pipeline/base.py#L468-L504","documentation":"Component names are used to build socket references like 'component.socket' in connect(), so they cannot contain dots. A name containing '.' makes socket parsing ambiguous and is rejected with ValueError.","triggerScenarios":"pipe.add_component(\"my.component\", comp) or add_components with dotted keys; deriving names from module paths or file names that contain dots.","commonSituations":"Auto-naming components from Python module paths (e.g. 'foo.bar.Comp'); users mirroring YAML key conventions with dots.","solutions":["Replace '.' with '_' in the component name","Sanitize generated names: name.replace('.', '_') before add_component","Use a delimiter other than '.' for your own naming scheme"],"exampleFix":"// before\npipe.add_component(\"pre.retriever\", retriever)\n// after\npipe.add_component(\"pre_retriever\", retriever)","handlingStrategy":"validation","validationCode":"def sanitize_name(name: str) -> str:\n    return name.replace(\".\", \"_\")","typeGuard":"def is_valid_component_name(name: str) -> bool:\n    return isinstance(name, str) and bool(name) and \".\" not in name and name != \"_debug\"","tryCatchPattern":"try:\n    pipe.add_component(name, comp)\nexcept ValueError as e:\n    if \"cannot contain '.'\" in str(e):\n        pipe.add_component(name.replace(\".\", \"_\"), comp)\n    else:\n        raise","preventionTips":["Sanitize externally sourced names before add_component","Never derive component names directly from module or file paths","Enforce a naming convention (alphanumeric + underscore) in your pipeline builder"],"tags":["python","pipeline","naming-conflict"],"backgroundTag":"invalid-identifier","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}