{"record":{"id":"902a2b1f08511476","repo":"deepset-ai/haystack","slug":"invalid-pipeline-snapshot-components-invalid-ord","errorCode":null,"errorMessage":"Invalid pipeline snapshot: components {invalid_ordered_components} in 'ordered_component_names' are not part of the current pipeline.","messagePattern":"Invalid pipeline snapshot: components (.+?) in 'ordered_component_names' are not part of the current pipeline\\.","errorType":"validation","errorClass":"PipelineInvalidPipelineSnapshotError","httpStatus":null,"severity":"error","filePath":"haystack/core/pipeline/breakpoint.py","lineNumber":71,"sourceCode":"\n\ndef _validate_pipeline_snapshot_against_pipeline(pipeline_snapshot: PipelineSnapshot, graph: MultiDiGraph) -> None:\n    \"\"\"\n    Validates that the pipeline_snapshot contains valid configuration for the current pipeline.\n\n    Raises a PipelineInvalidPipelineSnapshotError if any component in pipeline_snapshot is not part of the\n    target pipeline.\n\n    :param pipeline_snapshot: The saved state to validate.\n    \"\"\"\n\n    pipeline_state = pipeline_snapshot.pipeline_state\n    valid_components = set(graph.nodes.keys())\n\n    # Check if the ordered_component_names are valid components in the pipeline\n    invalid_ordered_components = set(pipeline_snapshot.ordered_component_names) - valid_components\n    if invalid_ordered_components:\n        raise PipelineInvalidPipelineSnapshotError(\n            f\"Invalid pipeline snapshot: components {invalid_ordered_components} in 'ordered_component_names' \"\n            f\"are not part of the current pipeline.\"\n        )\n\n    # Check if the original_input_data is valid components in the pipeline\n    serialized_input_data = pipeline_snapshot.original_input_data[\"serialized_data\"]\n    invalid_input_data = set(serialized_input_data.keys()) - valid_components\n    if invalid_input_data:\n        raise PipelineInvalidPipelineSnapshotError(\n            f\"Invalid pipeline snapshot: components {invalid_input_data} in 'input_data' \"\n            f\"are not part of the current pipeline.\"\n        )\n\n    # Validate 'component_visits'\n    invalid_component_visits = set(pipeline_state.component_visits.keys()) - valid_components\n    if invalid_component_visits:\n        raise PipelineInvalidPipelineSnapshotError(\n            f\"Invalid pipeline snapshot: components {invalid_component_visits} in 'component_visits' \"","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/pipeline/breakpoint.py#L53-L89","documentation":"_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.","triggerScenarios":"Calling pipeline.run(..., pipeline_snapshot=<snapshot>) where the snapshot was saved from a different or modified pipeline; resuming after adding/removing/renaming components.","commonSituations":"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.","solutions":["Resume with a snapshot produced by the exact same pipeline; re-run the original pipeline to regenerate the snapshot.","Remove stale component names from the snapshot's ordered_component_names if they are no longer relevant.","Revert pipeline edits (component names) so they match the snapshot's component set."],"exampleFix":"// before\nold_snapshot = load_pipeline_snapshot(\"snap.json\")  # from edited pipeline\nresult = pipeline.run(data, pipeline_snapshot=old_snapshot)\n// after\n# re-run the current pipeline to get a fresh breakpoint snapshot\nresult = pipeline.run(data, break_point=Breakpoint(component_name=\"retriever\", visit_count=1))","handlingStrategy":"validation","validationCode":"invalid = set(snapshot.ordered_component_names) - set(pipeline.graph.nodes)\nassert not invalid, f\"Snapshot has unknown components: {invalid}\"","typeGuard":"def snapshot_matches_pipeline(snapshot, pipeline) -> bool:\n    nodes = set(pipeline.graph.nodes)\n    return set(snapshot.ordered_component_names) <= nodes","tryCatchPattern":"try:\n    result = pipeline.run(data, pipeline_snapshot=snapshot)\nexcept PipelineInvalidPipelineSnapshotError as e:\n    logger.error(\"Snapshot is for a different pipeline: %s\", e)","preventionTips":["Save and resume snapshots with the exact same pipeline definition","Version-check pipelines before resuming snapshots","Re-run to obtain a fresh snapshot after any pipeline edit"],"tags":["haystack","pipeline","snapshot","validation"],"backgroundTag":"snapshot-mismatch","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}