{"record":{"id":"1f016aad8a56e5ce","repo":"langflow-ai/langflow","slug":"access-denied-knowledge-base-kb-name-is-manag","errorCode":null,"errorMessage":"Access denied: knowledge base '{kb_name}' is managed by a Memory Base.","messagePattern":"Access denied: knowledge base '(.+?)' is managed by a Memory Base\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"src/backend/base/langflow/api/v1/knowledge_bases.py","lineNumber":316,"sourceCode":"    resolved owner via :func:`_assert_kb_not_memory_base` so a shared\n    Memory-Base-managed KB still gets blocked.\n\n    A missing local directory is NOT treated as a 404 here because the\n    delete route handles the orphan-DB-row case downstream. This dep\n    only blocks Memory-Base-managed KBs from being touched; an\n    orphan row can't have Memory-Base metadata because that metadata\n    lives in the on-disk ``embedding_metadata.json`` which is gone.\n    \"\"\"\n    try:\n        kb_path = _resolve_kb_path(kb_name, current_user)\n    except HTTPException as exc:\n        if exc.status_code == HTTPStatus.NOT_FOUND:\n            return  # Let the route body handle the missing-dir case.\n        raise\n\n    metadata = KBAnalysisHelper.get_metadata(kb_path, fast=True)\n    if _is_memory_base_associated(metadata):\n        raise HTTPException(\n            status_code=403,\n            detail=f\"Access denied: knowledge base '{kb_name}' is managed by a Memory Base.\",\n        )\n\n\ndef _assert_kb_not_memory_base(kb_name: str, owner_user) -> None:\n    \"\"\"Post-resolution memory-base check.\n\n    The FastAPI dep :func:`_check_memory_base_association` only sees the\n    actor; for cross-user-reached KBs (a non-owner with a share grant) it\n    short-circuits because the actor has no same-named local KB. Route\n    bodies call this helper after :func:`_guard_kb_action` resolves the\n    real owner so Memory-Base-managed KBs are still blocked even when\n    reached through a share.\n    \"\"\"\n    try:\n        kb_path = _resolve_kb_path(kb_name, owner_user)\n    except HTTPException as exc:","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/knowledge_bases.py#L298-L334","documentation":"Error \"Access denied: knowledge base '{kb_name}' is managed by a Memory Base.\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when attempting to directly modify a knowledge base that is managed by a Memory Base and therefore read-only via this API.","commonSituations":"See trigger scenarios.","solutions":["Manage this knowledge base through its owning Memory Base instead of the KB API."],"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-15T17:31:12.345Z"}