langflow-ai/langflow · error · HTTPException
Knowledge base '{kb_name}' was recently deleted but its on-d
Error message
Knowledge base '{kb_name}' was recently deleted but its on-disk files are still being released by another process. Restart the server (or wait for the lock to clear) before recreating it with the same name. What it means
Error "Knowledge base '{kb_name}' was recently deleted but its on-disk files are still being released by another process. Restart the server (or wait for the lock to clear) before recreating it with the same name." thrown in langflow-ai/langflow.
Source
Thrown at src/backend/base/langflow/api/v1/knowledge_bases.py:747
# The username also roots the path, so it must be contained within the KB root
# too (a username with ".." would otherwise escape it before mkdir).
_validate_kb_path_containment(kb_root_path.resolve(), kb_user_path, kb_name, kb_user)
_validate_kb_path_containment(kb_user_path, kb_path, kb_name, kb_user)
# Check both durable DB state and legacy disk state. During
# expand/contract rollout a KB row can exist even if its local
# sidecar directory was cleaned up out of band.
existing_record = await knowledge_base_service.get_by_user_and_name(current_user.id, kb_name)
if existing_record is not None:
raise HTTPException(status_code=409, detail=f"Knowledge base '{kb_name}' already exists")
if kb_path.exists():
# No DB row but a directory survives. Two paths fork here:
# the dir is a leftover from a previous failed delete (carries
# the .kb_deleted sentinel) -- in which case the user clearly
# wants to reuse the name -- vs. a legitimate orphan from a
# legacy export. Only the sentinel case is safe to repurpose.
if KBStorageHelper.is_kb_dir_deleted(kb_path):
raise HTTPException(
status_code=409,
detail=(
f"Knowledge base '{kb_name}' was recently deleted but its on-disk files "
"are still being released by another process. Restart the server (or wait "
"for the lock to clear) before recreating it with the same name."
),
)
raise HTTPException(status_code=409, detail=f"Knowledge base '{kb_name}' already exists")
# Create KB directory. Clear any leftover sentinel just in case
# mkdir is racing with a sentinel write from a concurrent delete
# of the same name; ``clear_deletion_sentinel`` is a no-op when
# the marker is absent.
kb_path.mkdir(parents=True, exist_ok=True)
KBStorageHelper.clear_deletion_sentinel(kb_path)
kb_id = uuid.uuid4()
# Initialize Chroma storage and collection immediatelyView on GitHub (pinned to 976ec789d2)
Solutions
- Restart the server or wait for the file lock to clear, then recreate the knowledge base.
- Alternatively, create the knowledge base under a different name.
When it happens
Trigger: Occurs when recreating a recently deleted knowledge base whose on-disk files are still locked by another process.
Common situations: See trigger scenarios.
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/23cf67a6c1a75c28.
Report an issue: GitHub.