deepset-ai/haystack · error · PipelineInvalidPipelineSnapshotError

Invalid pipeline snapshot: components {invalid_ordered_compo

Error message

Invalid pipeline snapshot: components {invalid_ordered_components} in 'ordered_component_names' are not part of the current pipeline.

What it means

_validate_pipeline_snapshot_against_pipeline raises PipelineInvalidPipelineSnapshotError when any name in the snapshot's ordered_component_names is not a node of the current pipeline graph. Snapshots are only resumable on a pipeline whose component set matches the one that produced them.

Source

Thrown at haystack/core/pipeline/breakpoint.py:71


def _validate_pipeline_snapshot_against_pipeline(pipeline_snapshot: PipelineSnapshot, graph: MultiDiGraph) -> None:
    """
    Validates that the pipeline_snapshot contains valid configuration for the current pipeline.

    Raises a PipelineInvalidPipelineSnapshotError if any component in pipeline_snapshot is not part of the
    target pipeline.

    :param pipeline_snapshot: The saved state to validate.
    """

    pipeline_state = pipeline_snapshot.pipeline_state
    valid_components = set(graph.nodes.keys())

    # Check if the ordered_component_names are valid components in the pipeline
    invalid_ordered_components = set(pipeline_snapshot.ordered_component_names) - valid_components
    if invalid_ordered_components:
        raise PipelineInvalidPipelineSnapshotError(
            f"Invalid pipeline snapshot: components {invalid_ordered_components} in 'ordered_component_names' "
            f"are not part of the current pipeline."
        )

    # Check if the original_input_data is valid components in the pipeline
    serialized_input_data = pipeline_snapshot.original_input_data["serialized_data"]
    invalid_input_data = set(serialized_input_data.keys()) - valid_components
    if invalid_input_data:
        raise PipelineInvalidPipelineSnapshotError(
            f"Invalid pipeline snapshot: components {invalid_input_data} in 'input_data' "
            f"are not part of the current pipeline."
        )

    # Validate 'component_visits'
    invalid_component_visits = set(pipeline_state.component_visits.keys()) - valid_components
    if invalid_component_visits:
        raise PipelineInvalidPipelineSnapshotError(
            f"Invalid pipeline snapshot: components {invalid_component_visits} in 'component_visits' "

View on GitHub (pinned to e318778c9b)

Solutions

  1. Resume with a snapshot produced by the exact same pipeline; re-run the original pipeline to regenerate the snapshot.
  2. Remove stale component names from the snapshot's ordered_component_names if they are no longer relevant.
  3. Revert pipeline edits (component names) so they match the snapshot's component set.

Example fix

// before
old_snapshot = load_pipeline_snapshot("snap.json")  # from edited pipeline
result = pipeline.run(data, pipeline_snapshot=old_snapshot)
// after
# re-run the current pipeline to get a fresh breakpoint snapshot
result = pipeline.run(data, break_point=Breakpoint(component_name="retriever", visit_count=1))
Defensive patterns

Strategy: validation

Validate before calling

invalid = set(snapshot.ordered_component_names) - set(pipeline.graph.nodes)
assert not invalid, f"Snapshot has unknown components: {invalid}"

Type guard

def snapshot_matches_pipeline(snapshot, pipeline) -> bool:
    nodes = set(pipeline.graph.nodes)
    return set(snapshot.ordered_component_names) <= nodes

Try / catch

try:
    result = pipeline.run(data, pipeline_snapshot=snapshot)
except PipelineInvalidPipelineSnapshotError as e:
    logger.error("Snapshot is for a different pipeline: %s", e)

Prevention

When it happens

Trigger: Calling pipeline.run(..., pipeline_snapshot=<snapshot>) where the snapshot was saved from a different or modified pipeline; resuming after adding/removing/renaming components.

Common situations: Editing pipeline code between the breakpoint run and the resume; loading a snapshot file saved by a different pipeline instance; version drift where a component was renamed.

Related errors


AI-assisted analysis of deepset-ai/haystack@e318778c9b (2026-08-30). Data as JSON: /api/errors/902a2b1f08511476. Report an issue: GitHub.