langflow-ai/langflow · warning · HTTPException
An ingestion for this connector target is already queued or
Error message
An ingestion for this connector target is already queued or running. Wait for it to finish before starting another.
What it means
A 409 Conflict from the connector-ingest endpoint's idempotency guard: JobService.create_job rejects the job because a prior QUEUED/IN_PROGRESS/COMPLETED ingestion job carries the same dedupe key, built from (user, kb, source_type, source_config). FAILED/CANCELLED jobs do not block retries. This prevents double-clicking 'Ingest' from spawning duplicate connector jobs.
Source
Thrown at src/backend/base/langflow/api/v1/knowledge_bases.py:1893
kb_name=kb_name,
source_type=payload.source_type,
source_config=source_config,
)
job_service = get_job_service()
job_id = uuid.uuid4()
try:
await job_service.create_job(
job_id=job_id,
flow_id=job_id,
job_type=JobType.INGESTION,
asset_id=asset_id,
asset_type="knowledge_base",
user_id=current_user.id,
dedupe_key=dedupe_key,
)
except DuplicateJobError as exc:
raise HTTPException(
status_code=HTTPStatus.CONFLICT,
detail=(
"An ingestion for this connector target is already "
"queued or running. Wait for it to finish before "
"starting another."
),
) from exc
task_service = get_task_service()
await task_service.fire_and_forget_task(
job_service.execute_with_status,
job_id=job_id,
run_coro_func=KBIngestionHelper.perform_ingestion,
kb_name=kb_name,
kb_path=kb_path,
files_data=None,
chunk_size=payload.chunk_size,
chunk_overlap=payload.chunk_overlap,View on GitHub (pinned to 976ec789d2)
Solutions
- Check the status of the existing job (GET /api/v1/task/{job_id} or the KB's job list) and wait for it to finish instead of re-submitting.
- If you genuinely need to re-ingest the same target, cancel the running job first or wait for FAILED/CANCELLED state, which clears the dedupe block.
- Change the source_config meaningfully (e.g. different folder id/path) if you intend a distinct ingestion.
- Fix client retry logic to be idempotent-aware: treat 409 as 'already scheduled', not as a failure to retry.
Example fix
# before
resp = await client.post(url, json=payload) # blind retry on any error
# after: treat 409 as already-scheduled
resp = await client.post(url, json=payload)
if resp.status_code == 409:
job = await get_existing_job(kb, payload) # poll existing job
return job Defensive patterns
Strategy: try-catch
Validate before calling
async def no_active_ingest_for_target(client, kb: str, payload: dict) -> bool:
jobs = await list_kb_jobs(client, kb)
for job in jobs:
if job["status"] in ("queued", "in_progress"):
return False
return True Try / catch
try:
resp = await client.post(connector_url, json=payload)
except HTTPStatusError as e:
if e.response.status_code == 409:
job = await find_existing_job(kb, payload) # poll it instead of retrying
return job
raise Prevention
- Treat HTTP 409 as 'already scheduled', never as a retryable failure.
- Disable the Ingest button client-side while a job for the same target is queued/running.
- To force a fresh ingestion of an unchanged target, cancel the active job first or alter the config meaningfully.
When it happens
Trigger: POST /api/v1/knowledge_bases/{kb_name}/ingest/connector twice with the identical user, KB, source_type and source_config while the first ingestion job is still queued/running or already completed. Re-submitting an unchanged connector target after success reproduces it deterministically.
Common situations: Double-clicking the Ingest button, client retries on timeout that actually succeeded, or scripts re-running the same ingestion without changing any config parameter.
Related errors
- Assignment already exists for this user/role/domain
- destination already exists (already consolidated?): {dst}
- Bundle directory already exists: {bundle_dir}. Refusing to
- lfx-{bundle} already referenced in {ROOT_PYPROJECT.relative_
- Metadata value for '{key}' exceeds {KB_METADATA_MAX_VALUE_LE
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/ea9909abb0bc312f.
Report an issue: GitHub.