{"record":{"id":"58fa94a95c266709","repo":"langflow-ai/langflow","slug":"version-entry-not-found","errorCode":null,"errorMessage":"Version entry not found","messagePattern":"Version entry not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"src/backend/base/langflow/api/v1/flow_version.py","lineNumber":190,"sourceCode":"\n# TODO: Full-version export endpoint (export flow with all version entries embedded).\n# This is planned as a follow-up feature. The per-version export (exporting a single\n# version as a standalone flow) is available via the GET /{version_id} endpoint.\n\n\n@router.get(\"/{version_id}\")\nasync def get_single_flow_version(\n    flow_id: UUID,\n    version_id: UUID,\n    current_user: CurrentActiveUser,\n    session: DbSession,\n) -> FlowVersionReadWithData:\n    await _get_user_flow(session, flow_id, current_user.id)\n\n    try:\n        entry = await get_flow_version_entry_or_raise(session, version_id, current_user.id, flow_id=flow_id)\n    except FlowVersionNotFoundError as exc:\n        raise HTTPException(status_code=404, detail=\"Version entry not found\") from exc\n\n    return _version_to_read_full(entry, strip_keys=True)\n\n\n# shares FlowVersionRead model with list endpoint (inside FlowVersionListResponse),\n# but omits is_deployed field because its not relevant to this endpoint\n@router.post(\"/\", status_code=201, response_model_exclude={\"is_deployed\"})\nasync def create_snapshot(\n    flow_id: UUID,\n    current_user: CurrentActiveUser,\n    session: DbSession,\n    body: FlowVersionCreate | None = None,\n) -> FlowVersionRead:\n    flow = await _get_user_flow(session, flow_id, current_user.id)\n    await ensure_flow_permission(\n        current_user,\n        FlowAction.WRITE,\n        flow_id=flow.id,","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/flow_version.py#L172-L208","documentation":"404 from GET /flows/{flow_id}/versions/{version_id}: the flow passed the owner check, but get_flow_version_entry_or_raise found no FlowVersion row with that version_id for this user and flow — the domain exception FlowVersionNotFoundError is translated into a generic 'Version entry not found' HTTPException.","triggerScenarios":"Requesting a specific version entry that was deleted (explicitly or pruned by the version-retention limit inside create_flow_version_entry), a version belonging to a different flow, or a version id copied from another environment.","commonSituations":"Version pruning kicked in when many snapshots were created, removing the entry the client still references; parallel tabs holding stale version lists; re-pointing a client at a restored database with different version rows.","solutions":["Re-list versions via GET /flows/{flow_id}/versions/ to see which version_ids still exist","If the entry was pruned, snapshot the current flow state again to create a fresh version","Guard client flows that link to a specific version_id with a 404 fallback to the version list"],"exampleFix":"// before\nconst v = await getVersion(flowId, versionId);\n\n// after\nconst v = await getVersion(flowId, versionId).catch(async (e) => {\n  if (e.response?.status === 404) {\n    const list = await listVersions(flowId);\n    return list.items.at(-1) ?? null; // newest surviving version\n  }\n  throw e;\n});","handlingStrategy":"fallback","validationCode":"const { data } = await axios.get(`/api/v1/flows/${flowId}/versions/`);\nconst exists = data.items.some((v) => v.id === versionId);","typeGuard":null,"tryCatchPattern":"catch (e) {\n  if (e.response?.status === 404) return listVersions(flowId).then((l) => l.items.at(-1));\n  throw e;\n}","preventionTips":["Never hardcode version ids — always resolve them from a fresh list","Account for retention-based pruning when designing version-picker UIs","Invalidate cached version lists after any create/activate/delete operation"],"tags":["http-404","flow-versions","not-found","pruning"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}