langflow-ai/langflow · error · HTTPException
Knowledge base '{kb_name}' not found
Error message
Knowledge base '{kb_name}' not found What it means
Error "Knowledge base '{kb_name}' not found" thrown in langflow-ai/langflow.
Source
Thrown at src/backend/base/langflow/api/v1/knowledge_bases.py:239
Raises 403 if path traversal is detected (kb_name escapes the user directory).
Raises 404 if the KB directory does not exist.
"""
kb_root_path = KBStorageHelper.get_root_path()
kb_user = owner_user.username
kb_user_path = (kb_root_path / kb_user).resolve()
kb_path = (kb_user_path / kb_name).resolve()
# The username roots the KB directory, so a username containing path separators
# or ".." (e.g. "../../etc") could make kb_user_path resolve outside kb_root_path
# while kb_path stays "contained" within that escaped base — bypassing the kb_name
# check below and enabling arbitrary-directory access/deletion. Check containment
# against the real root first, then the user dir for kb_name, matching the list
# endpoint's guard.
_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)
if not kb_path.exists() or not kb_path.is_dir():
raise HTTPException(status_code=404, detail=f"Knowledge base '{kb_name}' not found")
return kb_path
def _build_connector_ingest_dedupe_key(
*,
user_id: uuid.UUID,
kb_name: str,
source_type: str,
source_config: dict[str, Any],
) -> str:
"""Build a stable idempotency key for a connector-driven ingestion job.
The key is a SHA-256 hash of ``(user, kb, source_type, sorted_config)``
so semantically-equivalent requests collapse to the same key regardless
of JSON key ordering. Only the hash (not the config) goes on the
``job`` row, so no credentials leak through ``dedupe_key``.
"""
canonical = json.dumps(View on GitHub (pinned to 976ec789d2)
Solutions
- Verify the knowledge base name; it may have been deleted or renamed.
When it happens
Trigger: Occurs when the named knowledge base does not exist for the current user.
Common situations: See trigger scenarios.
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/a8a167a619c875e9.
Report an issue: GitHub.