{"record":{"id":"3a0e4187c68d40c4","repo":"Significant-Gravitas/AutoGPT","slug":"libraryagent-for-graph-graph-model-id-v-graph-m","errorCode":null,"errorMessage":"LibraryAgent for graph #{graph_model.id} v{graph_model.version} not found after UniqueViolationError","messagePattern":"LibraryAgent for graph #(.+?) v(.+?) not found after UniqueViolationError","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/_add_to_library.py","lineNumber":156,"sourceCode":"                    \"agentGraphVersion\": graph_model.version,\n                }\n            },\n            data={\n                \"isDeleted\": False,\n                \"isArchived\": False,\n                \"settings\": settings_json,\n                \"name\": marketplace[\"name\"],\n                \"description\": marketplace[\"description\"],\n                \"imageUrl\": marketplace[\"imageUrl\"],\n                # Deliberately leave organizationId/Team untouched on re-add:\n                # an existing bookmark already carries its tenancy. Only the\n                # create branch tenants; re-tagging here risked disconnecting\n                # an existing team when a default team couldn't be resolved.\n            },\n            include=_include,\n        )\n        if added_agent is None:\n            raise NotFoundError(\n                f\"LibraryAgent for graph #{graph_model.id} \"\n                f\"v{graph_model.version} not found after UniqueViolationError\"\n            )\n\n    logger.debug(\n        f\"Added graph #{graph_model.id} v{graph_model.version} \"\n        f\"for store listing version #{store_listing_version.id} \"\n        f\"to library for user #{user_id}\"\n    )\n    schedule_info = await _fetch_schedule_info(user_id, graph_id=graph_model.id)\n    return library_model.LibraryAgent.from_db(added_agent, schedule_info=schedule_info)\n","sourceCodeStart":138,"sourceCodeEnd":168,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/_add_to_library.py#L138-L168","documentation":"Error \"LibraryAgent for graph #{graph_model.id} v{graph_model.version} not found after UniqueViolationError\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/_add_to_library.py:156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the add-to-library request; this indicates a concurrent-create race that should resolve.","If it persists, check server logs and database integrity for the library agent entry."],"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"}