langflow-ai/langflow · error · HTTPException
Error ingesting via connector.
Error message
Error ingesting via connector.
What it means
Generic 500 raised by the connector-based knowledge-base ingestion endpoint (POST /api/v1/knowledge_bases/{kb_name}/ingest with a connector source). Any non-HTTP exception thrown while scheduling or launching the ingestion job (job creation, model_selection handling, job_service interaction) is caught, logged server-side as 'Error ingesting via connector to KB: <e>', and re-raised as this 500 with the original exception chained. The client message intentionally hides the root cause; the server log has it.
Source
Thrown at src/backend/base/langflow/api/v1/knowledge_bases.py:1926
kb_path=kb_path,
files_data=None,
chunk_size=payload.chunk_size,
chunk_overlap=payload.chunk_overlap,
separator=payload.separator,
source_name=payload.source_name,
current_user=current_user,
model_selection=model_selection,
task_job_id=job_id,
job_service=job_service,
source=source,
)
return TaskResponse(id=str(job_id), href=f"/task/{job_id}")
except HTTPException:
raise
except Exception as e:
await logger.aerror("Error ingesting via connector to KB: %s", e)
raise HTTPException(status_code=500, detail="Error ingesting via connector.") from e
@router.get("/{kb_name}/runs", status_code=HTTPStatus.OK)
async def list_ingestion_runs(
kb_name: str,
current_user: CurrentActiveUser,
page: Annotated[int, Query(ge=1)] = 1,
limit: Annotated[int, Query(ge=1, le=100)] = 50,
) -> PaginatedIngestionRunResponse:
"""Paginated list of ingestion runs for a KB (newest first).
Scoped to the requesting user so one account can't observe
another's run history. Returns counter-only rows; the UI fetches
the detail endpoint for the drill-down.
"""
_kb_guard = await _guard_kb_action(current_user=current_user, action=KnowledgeBaseAction.READ, kb_name=kb_name)
# Verify the KB path exists + traversal-safe before exposing run
# history — otherwise a crafted ``kb_name`` could be used to probeView on GitHub (pinned to 976ec789d2)
Solutions
- Read the server log line 'Error ingesting via connector to KB: ...' — the chained exception names the real cause
- Verify the connector's credentials/configuration in the KB settings and re-test the connector standalone
- Check the job service / task queue is reachable and healthy (other ingestion endpoints work?)
- Reproduce with a minimal 1-file connector ingestion to isolate payload vs infrastructure issues
Defensive patterns
Strategy: try-catch
Try / catch
try:
resp = await client.post(f"/api/v1/knowledge_bases/{kb}/ingest", json=payload)
except httpx.HTTPStatusError as e:
if e.response.status_code == 500 and "connector" in e.response.json()["detail"]:
# root cause only in server logs; surface retry option to user
raise IngestionStartError(kb) from e
raise Prevention
- Validate connector credentials with a standalone test call before starting ingestion
- Health-check the job/queue backend before kicking off connector ingestion
- Show server-log correlation ids in the UI so users can attach logs to bug reports
When it happens
Trigger: POST /api/v1/knowledge_bases/{kb_name}/ingest in connector mode where the code between job setup and TaskResponse creation raises: job_service failures, invalid connector configuration, DB errors inserting the job row, or an invalid model_selection that survives earlier validation.
Common situations: Connector credentials missing/expired (e.g. bad API key for the connector provider), job/queue backend unreachable or misconfigured, database locked or down, deploying a new connector type without registering its job handler.
Related errors
- Error ingesting files to knowledge base.
- Error deleting knowledge base.
- Error deleting knowledge bases.
- 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/c151ed0aaf5facff.
Report an issue: GitHub.