deepset-ai/haystack · error · InvalidMappingValueError
Input socket '{socket_name}' not found in component '{comp_n
Error message
Input socket '{socket_name}' not found in component '{comp_name}'.
Available inputs for '{comp_name}': {list(pipeline_inputs[comp_name].keys())} What it means
The socket part of an input_mapping path must be an input socket of the referenced component. If socket_name is not among that component's input sockets, InvalidMappingValueError is raised listing the available inputs.
Source
Thrown at haystack/core/super_component/super_component.py:209
If the input mapping is of invalid type or contains invalid types.
:raises InvalidMappingValueError:
If the input mapping contains nonexistent components or sockets.
"""
if not isinstance(input_mapping, dict):
raise InvalidMappingTypeError("input_mapping must be a dictionary")
for wrapper_input_name, pipeline_input_paths in input_mapping.items():
if not isinstance(pipeline_input_paths, list):
raise InvalidMappingTypeError(f"Input paths for '{wrapper_input_name}' must be a list of strings.")
for path in pipeline_input_paths:
comp_name, socket_name = self._split_component_path(path)
if comp_name not in pipeline_inputs:
raise InvalidMappingValueError(
f"Component '{comp_name}' not found in pipeline inputs.\n"
f"Available components: {list(pipeline_inputs.keys())}"
)
if socket_name not in pipeline_inputs[comp_name]:
raise InvalidMappingValueError(
f"Input socket '{socket_name}' not found in component '{comp_name}'.\n"
f"Available inputs for '{comp_name}': {list(pipeline_inputs[comp_name].keys())}"
)
def _resolve_input_types_from_mapping(
self, pipeline_inputs: dict[str, dict[str, Any]], input_mapping: dict[str, list[str]]
) -> dict[str, dict[str, Any]]:
"""
Resolves and validates input types based on the provided input mapping.
This function ensures that all mapped pipeline inputs are compatible, consolidating types
when multiple mappings exist. It also determines whether an input is mandatory or has a default value.
:param pipeline_inputs: A dictionary containing pipeline input specifications.
:param input_mapping: A dictionary mapping SuperComponent inputs to pipeline socket paths.
:returns:
A dictionary specifying the resolved input types and their properties.
:raises InvalidMappingTypeError:View on GitHub (pinned to e318778c9b)
Solutions
- Use a socket that appears in pipeline.inputs()[comp_name].keys()
- Check the component's run() signature for the correct input parameter name
Example fix
// before
input_mapping = {"text": ["embedder.documents"]}
// after
input_mapping = {"text": ["embedder.text"]} Defensive patterns
Strategy: validation
Validate before calling
def check_sockets(pipe, input_mapping):
inputs = pipe.inputs()
for paths in input_mapping.values():
for p in paths:
comp, sock = p.split(".")
if sock not in inputs[comp]:
raise ValueError(f"'{sock}' not an input of '{comp}': {list(inputs[comp].keys())}") Type guard
def socket_exists(pipe, path: str) -> bool:
comp, sock = path.split(".")
return sock in pipe.inputs().get(comp, {}) Try / catch
from haystack.core.errors import InvalidMappingValueError
try:
super_comp = SuperComponent(pipeline=pipe, input_mapping=input_mapping)
except InvalidMappingValueError as e:
if "Input socket" in str(e):
print("Check component input sockets:", e)
else:
raise Prevention
- Verify socket names against the component's run() signature
- Consult pipeline.inputs() rather than guessing socket names
- Re-check mappings after upgrading haystack (socket names can change)
When it happens
Trigger: Path like ['embedder.documents'] where SentenceTransformersTextEmbedder's input is 'text'; referencing an output socket in input_mapping; typos in socket names.
Common situations: Confusing input and output socket names; component API changed between haystack versions (renamed sockets); using a wrong socket for components with multiple inputs.
Related errors
- input_mapping must be a dictionary
- Input paths for '{wrapper_input_name}' must be a list of str
- Component '{comp_name}' not found in pipeline inputs. Availa
- Type conflict for input '{socket_name}' from component '{com
- Pipeline must be provided to SuperComponent.
AI-assisted analysis of deepset-ai/haystack@e318778c9b (2026-08-30).
Data as JSON: /api/errors/f410e05875d17ec8.
Report an issue: GitHub.