{"record":{"id":"738da16945a72a53","repo":"Significant-Gravitas/AutoGPT","slug":"folder-folder-id-not-found","errorCode":null,"errorMessage":"Folder #{folder_id} not found","messagePattern":"Folder #(.+?) not found","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/db.py","lineNumber":1368,"sourceCode":"        user_id: The ID of the user (for ownership verification).\n\n    Returns:\n        The LibraryFolder object.\n\n    Raises:\n        NotFoundError: If the folder doesn't exist or doesn't belong to the user.\n    \"\"\"\n    folder = await prisma.models.LibraryFolder.prisma().find_first(\n        where={\n            \"id\": folder_id,\n            \"userId\": user_id,\n            \"isDeleted\": False,\n        },\n        include=LIBRARY_FOLDER_INCLUDE,\n    )\n\n    if not folder:\n        raise NotFoundError(f\"Folder #{folder_id} not found\")\n\n    return library_model.LibraryFolder.from_db(\n        folder,\n        agent_count=len(folder.LibraryAgents) if folder.LibraryAgents else 0,\n        subfolder_count=len(folder.Children) if folder.Children else 0,\n    )\n\n\nasync def _is_descendant_of(\n    folder_id: str,\n    potential_ancestor_id: str,\n    user_id: str,\n) -> bool:\n    \"\"\"\n    Check if folder_id is a descendant of (or equal to) potential_ancestor_id.\n\n    Fetches all user folders in a single query and walks the parent chain\n    in memory to avoid N database round-trips.","sourceCodeStart":1350,"sourceCodeEnd":1386,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/db.py#L1350-L1386","documentation":"Error \"Folder #{folder_id} not found\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/db.py:1368 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the folder ID exists and belongs to your account.","Refresh the folder list; the folder may have been deleted."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}