langflow-ai/langflow · warning · HTTPException

Ingestion run not found.

Error message

Ingestion run not found.

What it means

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).

Source

Thrown at src/backend/base/langflow/api/v1/knowledge_bases.py:1977

        page=page,
        limit=limit,
        total_pages=total_pages,
    )


@router.get("/{kb_name}/runs/{run_id}", status_code=HTTPStatus.OK)
async def get_ingestion_run(
    kb_name: str,
    run_id: uuid.UUID,
    current_user: CurrentActiveUser,
) -> IngestionRunDetail:
    """Full run detail including per-item breakdown + error messages."""
    _kb_guard = await _guard_kb_action(current_user=current_user, action=KnowledgeBaseAction.READ, kb_name=kb_name)
    _resolve_kb_path(kb_name, _kb_guard.owner_user)

    row = await ingestion_run_service.get_run(run_id, user_id=_kb_guard.owner_user.id)
    if row is None or row.kb_name != kb_name:
        raise HTTPException(status_code=404, detail="Ingestion run not found.")

    base = _run_row_to_info(row)
    items = [
        IngestionRunItemInfo(
            item_id=item.get("item_id", ""),
            display_name=item.get("display_name", ""),
            status=item.get("status", "succeeded"),
            chunks_created=int(item.get("chunks_created", 0) or 0),
            error_message=item.get("error_message"),
        )
        for item in (row.items or [])
    ]
    return IngestionRunDetail(
        **base.model_dump(),
        source_config=row.source_config or {},
        items=items,
    )

View on GitHub (pinned to 976ec789d2)

Solutions

  1. List runs first (GET /{kb_name}/runs) and confirm the run id is present for that KB
  2. Verify you are authenticated as the user who owns the KB/run — runs are user-scoped
  3. Check the run id is a valid UUID and matches the KB name exactly (case-sensitive)

Example fix

// before
const run = await api.get(`/api/v1/knowledge_bases/${kbName}/runs/${runId}`);

// after
const runs = await api.get(`/api/v1/knowledge_bases/${kbName}/runs`);
const exists = runs.data.results?.some((r) => r.id === runId);
if (!exists) throw new Error(`Run ${runId} not in ${kbName}`);
const run = await api.get(`/api/v1/knowledge_bases/${kbName}/runs/${runId}`);
Defensive patterns

Strategy: validation

Validate before calling

runs = await client.get(f"/api/v1/knowledge_bases/{kb_name}/runs")
owned = {r["id"] for r in runs.json()["results"]}
assert run_id in owned, f"run {run_id} not in {kb_name}"

Try / catch

try:
    detail = await client.get(f"/api/v1/knowledge_bases/{kb_name}/runs/{run_id}")
except httpx.HTTPStatusError as e:
    if e.response.status_code == 404:
        return None  # treat as absent, refresh run list
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/990ad52a1a3a41c5. Report an issue: GitHub.