{"record":{"id":"676809f0fcfc232e","repo":"Significant-Gravitas/AutoGPT","slug":"store-listing-version-store-listing-version-id-n","errorCode":null,"errorMessage":"Store listing version {store_listing_version_id} not found or invalid","messagePattern":"Store listing version (.+?) not found or invalid","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/_add_to_library.py","lineNumber":43,"sourceCode":"async def resolve_graph_for_library(\n    store_listing_version_id: str,\n    user_id: str,\n    *,\n    admin: bool,\n) -> tuple[GraphModel, prisma.models.StoreListingVersion]:\n    \"\"\"Look up a StoreListingVersion and resolve its graph.\n\n    When ``admin=True``, uses ``get_graph_as_admin`` to bypass the marketplace\n    APPROVED-only check.  Otherwise uses the regular ``get_graph``.\n\n    Returns the resolved graph together with the StoreListingVersion, so callers\n    can snapshot marketplace metadata without re-querying it.\n    \"\"\"\n    slv = await prisma.models.StoreListingVersion.prisma().find_unique(\n        where={\"id\": store_listing_version_id}, include={\"AgentGraph\": True}\n    )\n    if not slv or not slv.AgentGraph:\n        raise NotFoundError(\n            f\"Store listing version {store_listing_version_id} not found or invalid\"\n        )\n\n    ag = slv.AgentGraph\n    if admin:\n        graph_model = await graph_db.get_graph_as_admin(\n            graph_id=ag.id, version=ag.version, user_id=user_id\n        )\n    else:\n        graph_model = await graph_db.get_graph(\n            graph_id=ag.id, version=ag.version, user_id=user_id\n        )\n\n    if not graph_model:\n        raise NotFoundError(f\"Graph #{ag.id} v{ag.version} not found or accessible\")\n    return graph_model, slv\n\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/_add_to_library.py#L25-L61","documentation":"Error \"Store listing version {store_listing_version_id} not found or invalid\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/_add_to_library.py:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the store listing version ID exists and is approved/available in the store.","Refresh the store listing and retry with a valid version ID."],"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"}