{"record":{"id":"62d19af4a97dafaf","repo":"deepset-ai/haystack","slug":"invalid-pipeline-snapshot-components-invalid-com","errorCode":null,"errorMessage":"Invalid pipeline snapshot: components {invalid_component_visits} in 'component_visits' are not part of the current pipeline.","messagePattern":"Invalid pipeline snapshot: components (.+?) in 'component_visits' are not part of the current pipeline\\.","errorType":"validation","errorClass":"PipelineInvalidPipelineSnapshotError","httpStatus":null,"severity":"error","filePath":"haystack/core/pipeline/breakpoint.py","lineNumber":88,"sourceCode":"    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' \"\n            f\"are not part of the current pipeline.\"\n        )\n\n    component_name = pipeline_snapshot.break_point.component_name\n    visit_count = pipeline_snapshot.pipeline_state.component_visits[component_name]\n\n    logger.info(\n        \"Resuming pipeline from {component} with visit count {visits}\", component=component_name, visits=visit_count\n    )\n\n\ndef load_pipeline_snapshot(file_path: str | Path) -> PipelineSnapshot:\n    \"\"\"\n    Load a saved pipeline snapshot.\n\n    :param file_path: Path to the pipeline_snapshot file.\n    :returns:","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/pipeline/breakpoint.py#L70-L106","documentation":"_validate_pipeline_snapshot_against_pipeline raises PipelineInvalidPipelineSnapshotError when the snapshot's component_visits dict contains component names absent from the current pipeline graph. Visit counts track how many times each component has run and must refer to real components for resume logic.","triggerScenarios":"Resuming a snapshot saved from a different or edited pipeline; hand-editing the snapshot's component_visits keys; deserializing a snapshot after components were renamed.","commonSituations":"Cross-pipeline snapshot reuse; pipeline definition changed between save and resume; manually authored snapshot files in tests or tooling.","solutions":["Regenerate the snapshot with the current pipeline so component_visits keys are valid.","Delete entries for non-existent components from component_visits (keeping at least the break_point component's count).","Rename the stale keys to the current component names if they were merely renamed."],"exampleFix":"// before\nsnapshot.pipeline_state.component_visits = {\"old_llm\": 2}\n// after\nsnapshot.pipeline_state.component_visits = {\"llm\": 2}","handlingStrategy":"validation","validationCode":"invalid = set(snapshot.pipeline_state.component_visits) - set(pipeline.graph.nodes)\nassert not invalid, f\"component_visits references unknown components: {invalid}\"","typeGuard":"def visits_valid(snapshot, pipeline) -> bool:\n    return set(snapshot.pipeline_state.component_visits) <= set(pipeline.graph.nodes)","tryCatchPattern":"try:\n    result = pipeline.run(data, pipeline_snapshot=snapshot)\nexcept PipelineInvalidPipelineSnapshotError as e:\n    logger.error(\"Snapshot component_visits invalid: %s\", e)","preventionTips":["Keep component_visits keys aligned with current component names","Validate the whole snapshot (names, input_data, visits) before resume","Store pipeline identity/version alongside snapshots"],"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"}