{"record":{"id":"990ad52a1a3a41c5","repo":"langflow-ai/langflow","slug":"ingestion-run-not-found","errorCode":null,"errorMessage":"Ingestion run not found.","messagePattern":"Ingestion run not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"src/backend/base/langflow/api/v1/knowledge_bases.py","lineNumber":1977,"sourceCode":"        page=page,\n        limit=limit,\n        total_pages=total_pages,\n    )\n\n\n@router.get(\"/{kb_name}/runs/{run_id}\", status_code=HTTPStatus.OK)\nasync def get_ingestion_run(\n    kb_name: str,\n    run_id: uuid.UUID,\n    current_user: CurrentActiveUser,\n) -> IngestionRunDetail:\n    \"\"\"Full run detail including per-item breakdown + error messages.\"\"\"\n    _kb_guard = await _guard_kb_action(current_user=current_user, action=KnowledgeBaseAction.READ, kb_name=kb_name)\n    _resolve_kb_path(kb_name, _kb_guard.owner_user)\n\n    row = await ingestion_run_service.get_run(run_id, user_id=_kb_guard.owner_user.id)\n    if row is None or row.kb_name != kb_name:\n        raise HTTPException(status_code=404, detail=\"Ingestion run not found.\")\n\n    base = _run_row_to_info(row)\n    items = [\n        IngestionRunItemInfo(\n            item_id=item.get(\"item_id\", \"\"),\n            display_name=item.get(\"display_name\", \"\"),\n            status=item.get(\"status\", \"succeeded\"),\n            chunks_created=int(item.get(\"chunks_created\", 0) or 0),\n            error_message=item.get(\"error_message\"),\n        )\n        for item in (row.items or [])\n    ]\n    return IngestionRunDetail(\n        **base.model_dump(),\n        source_config=row.source_config or {},\n        items=items,\n    )\n","sourceCodeStart":1959,"sourceCodeEnd":1995,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/knowledge_bases.py#L1959-L1995","documentation":"404 from GET /api/v1/knowledge_bases/{kb_name}/runs/{run_id}. The endpoint guards the KB, resolves the owner, then looks up the ingestion run by id scoped to that user. It raises 404 when the run row does not exist OR when the row exists but its kb_name does not match the requested KB — so a run id from a different knowledge base looks identical to a nonexistent one (UUID privacy).","triggerScenarios":"GET /{kb_name}/runs/{run_id} with a run id that (a) was never created, (b) belongs to another user, (c) belongs to a different KB than kb_name, or (d) a typo'd/truncated UUID.","commonSituations":"Frontend navigating to a run detail page from a stale link after the KB was recreated; copy-pasting a run id between environments; polling a run whose retention window expired.","solutions":["List runs first (GET /{kb_name}/runs) and confirm the run id is present for that KB","Verify you are authenticated as the user who owns the KB/run — runs are user-scoped","Check the run id is a valid UUID and matches the KB name exactly (case-sensitive)"],"exampleFix":"// before\nconst run = await api.get(`/api/v1/knowledge_bases/${kbName}/runs/${runId}`);\n\n// after\nconst runs = await api.get(`/api/v1/knowledge_bases/${kbName}/runs`);\nconst exists = runs.data.results?.some((r) => r.id === runId);\nif (!exists) throw new Error(`Run ${runId} not in ${kbName}`);\nconst run = await api.get(`/api/v1/knowledge_bases/${kbName}/runs/${runId}`);","handlingStrategy":"validation","validationCode":"runs = await client.get(f\"/api/v1/knowledge_bases/{kb_name}/runs\")\nowned = {r[\"id\"] for r in runs.json()[\"results\"]}\nassert run_id in owned, f\"run {run_id} not in {kb_name}\"","typeGuard":null,"tryCatchPattern":"try:\n    detail = await client.get(f\"/api/v1/knowledge_bases/{kb_name}/runs/{run_id}\")\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 404:\n        return None  # treat as absent, refresh run list\n    raise","preventionTips":["Always source run ids from the list endpoint for that exact KB name","Treat 404 as 'absent', not an error, in polling loops","Re-check the runs list after KB recreate/restore events"],"tags":["knowledge-base","ingestion-run","http-404","langflow"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}