langflow-ai/langflow · error · HTTPException
Error cancelling ingestion.
Error message
Error cancelling ingestion.
What it means
Catch-all 500 from POST /api/v1/knowledge_bases/{kb_name}/cancel. Exceptions raised during task revocation, job-status update, or partial-chunk cleanup (the endpoint forwards the KB backend + user_id so remote stores clean up correctly) are logged as 'Error cancelling ingestion: <e>' and become this 500. asyncio.CancelledError and HTTPExceptions are re-raised untouched, so this is genuinely unexpected infrastructure failure.
Source
Thrown at src/backend/base/langflow/api/v1/knowledge_bases.py:2337
job.job_id,
kb_path,
kb_name,
backend_type=backend_type_value,
backend_config=backend_config,
user_id=current_user.id,
)
if revoked:
message = f"Ingestion job for {job.job_id} cancelled successfully."
else:
message = f"Job {job.job_id} is already cancelled."
except asyncio.CancelledError:
raise
except HTTPException:
raise
except Exception as e:
await logger.aerror("Error cancelling ingestion: %s", e)
raise HTTPException(status_code=500, detail="Error cancelling ingestion.") from e
else:
return {"message": message}
View on GitHub (pinned to 976ec789d2)
Solutions
- Check server log 'Error cancelling ingestion: ...' for the chained cause
- Verify the task broker (Redis) is reachable — revoke_task needs it
- Check remote vector-store credentials/variables for the KB are still valid
- Retry the cancel; note the job may already be marked CANCELLED if the failure happened after update_job_status
Defensive patterns
Strategy: try-catch
Try / catch
try:
await client.post(f"/api/v1/knowledge_bases/{kb_name}/cancel")
except httpx.HTTPStatusError as e:
if e.response.status_code == 500:
# job may already be CANCELLED — re-check state before retrying
state = await get_latest_run_status(client, kb_name)
if state == "cancelled":
return
raise Prevention
- Verify the task broker (Redis) is healthy before issuing cancels
- Keep remote KB vector-store credential variables valid so cleanup cannot throw
- Re-read job status after a failed cancel — the status update may have landed before the error
When it happens
Trigger: task_service.revoke_task failing (broker down), job_service.update_job_status hitting a DB error, or chunk cleanup failing against a remote vector store (Mongo/Astra/Postgres) with a non-HTTP exception.
Common situations: Redis/task broker unavailable; remote vector-store credentials rotated so cleanup cannot connect; DB locked by a concurrent ingestion write.
Related errors
- Error deleting knowledge bases.
- Error ingesting via connector.
- Error deleting knowledge base.
- No ingestion job found for the knowledge base {kb_name}
- Cannot cancel job with status '{job_status}'
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/9589e8bfb0e72c7e.
Report an issue: GitHub.