{"record":{"id":"a8a167a619c875e9","repo":"langflow-ai/langflow","slug":"knowledge-base-kb-name-not-found","errorCode":null,"errorMessage":"Knowledge base '{kb_name}' not found","messagePattern":"Knowledge base '(.+?)' not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"src/backend/base/langflow/api/v1/knowledge_bases.py","lineNumber":239,"sourceCode":"    Raises 403 if path traversal is detected (kb_name escapes the user directory).\n    Raises 404 if the KB directory does not exist.\n    \"\"\"\n    kb_root_path = KBStorageHelper.get_root_path()\n    kb_user = owner_user.username\n    kb_user_path = (kb_root_path / kb_user).resolve()\n    kb_path = (kb_user_path / kb_name).resolve()\n\n    # The username roots the KB directory, so a username containing path separators\n    # or \"..\" (e.g. \"../../etc\") could make kb_user_path resolve outside kb_root_path\n    # while kb_path stays \"contained\" within that escaped base — bypassing the kb_name\n    # check below and enabling arbitrary-directory access/deletion. Check containment\n    # against the real root first, then the user dir for kb_name, matching the list\n    # endpoint's guard.\n    _validate_kb_path_containment(kb_root_path.resolve(), kb_user_path, kb_name, kb_user)\n    _validate_kb_path_containment(kb_user_path, kb_path, kb_name, kb_user)\n\n    if not kb_path.exists() or not kb_path.is_dir():\n        raise HTTPException(status_code=404, detail=f\"Knowledge base '{kb_name}' not found\")\n    return kb_path\n\n\ndef _build_connector_ingest_dedupe_key(\n    *,\n    user_id: uuid.UUID,\n    kb_name: str,\n    source_type: str,\n    source_config: dict[str, Any],\n) -> str:\n    \"\"\"Build a stable idempotency key for a connector-driven ingestion job.\n\n    The key is a SHA-256 hash of ``(user, kb, source_type, sorted_config)``\n    so semantically-equivalent requests collapse to the same key regardless\n    of JSON key ordering. Only the hash (not the config) goes on the\n    ``job`` row, so no credentials leak through ``dedupe_key``.\n    \"\"\"\n    canonical = json.dumps(","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/knowledge_bases.py#L221-L257","documentation":"Error \"Knowledge base '{kb_name}' not found\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when the named knowledge base does not exist for the current user.","commonSituations":"See trigger scenarios.","solutions":["Verify the knowledge base name; it may have been deleted or renamed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}