{"record":{"id":"c151ed0aaf5facff","repo":"langflow-ai/langflow","slug":"error-ingesting-via-connector","errorCode":null,"errorMessage":"Error ingesting via connector.","messagePattern":"Error ingesting via connector\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/v1/knowledge_bases.py","lineNumber":1926,"sourceCode":"            kb_path=kb_path,\n            files_data=None,\n            chunk_size=payload.chunk_size,\n            chunk_overlap=payload.chunk_overlap,\n            separator=payload.separator,\n            source_name=payload.source_name,\n            current_user=current_user,\n            model_selection=model_selection,\n            task_job_id=job_id,\n            job_service=job_service,\n            source=source,\n        )\n        return TaskResponse(id=str(job_id), href=f\"/task/{job_id}\")\n\n    except HTTPException:\n        raise\n    except Exception as e:\n        await logger.aerror(\"Error ingesting via connector to KB: %s\", e)\n        raise HTTPException(status_code=500, detail=\"Error ingesting via connector.\") from e\n\n\n@router.get(\"/{kb_name}/runs\", status_code=HTTPStatus.OK)\nasync def list_ingestion_runs(\n    kb_name: str,\n    current_user: CurrentActiveUser,\n    page: Annotated[int, Query(ge=1)] = 1,\n    limit: Annotated[int, Query(ge=1, le=100)] = 50,\n) -> PaginatedIngestionRunResponse:\n    \"\"\"Paginated list of ingestion runs for a KB (newest first).\n\n    Scoped to the requesting user so one account can't observe\n    another's run history. Returns counter-only rows; the UI fetches\n    the detail endpoint for the drill-down.\n    \"\"\"\n    _kb_guard = await _guard_kb_action(current_user=current_user, action=KnowledgeBaseAction.READ, kb_name=kb_name)\n    # Verify the KB path exists + traversal-safe before exposing run\n    # history — otherwise a crafted ``kb_name`` could be used to probe","sourceCodeStart":1908,"sourceCodeEnd":1944,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/knowledge_bases.py#L1908-L1944","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = await client.post(f\"/api/v1/knowledge_bases/{kb}/ingest\", json=payload)\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 500 and \"connector\" in e.response.json()[\"detail\"]:\n        # root cause only in server logs; surface retry option to user\n        raise IngestionStartError(kb) from e\n    raise","preventionTips":["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"],"tags":["knowledge-base","ingestion","connector","http-500","langflow"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}