{"record":{"id":"dbb3c9151ab33d8d","repo":"Significant-Gravitas/AutoGPT","slug":"store-listing-version-store-listing-version-id-n-dbb3c9","errorCode":null,"errorMessage":"Store listing version {store_listing_version_id} not found","messagePattern":"Store listing version (.+?) not found","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/store/db.py","lineNumber":378,"sourceCode":"async def get_available_graph(\n    store_listing_version_id: str,\n    hide_nodes: bool = True,\n) -> GraphModelWithoutNodes | GraphModel:\n    try:\n        # Get avaialble, non-deleted store listing version\n        store_listing_version = (\n            await prisma.models.StoreListingVersion.prisma().find_first(\n                where={\n                    \"id\": store_listing_version_id,\n                    \"isAvailable\": True,\n                    \"isDeleted\": False,\n                },\n                include={\"AgentGraph\": {\"include\": AGENT_GRAPH_INCLUDE}},\n            )\n        )\n\n        if not store_listing_version or not store_listing_version.AgentGraph:\n            raise NotFoundError(\n                f\"Store listing version {store_listing_version_id} not found\",\n            )\n\n        return (GraphModelWithoutNodes if hide_nodes else GraphModel).from_db(\n            store_listing_version.AgentGraph\n        )\n\n    except Exception as e:\n        logger.error(f\"Error getting agent: {e}\")\n        raise DatabaseError(\"Failed to fetch agent\") from e\n\n\nasync def get_store_agent_by_version_id(\n    store_listing_version_id: str,\n) -> store_model.StoreAgentDetails:\n    \"\"\"Get agent details from the StoreAgent view (APPROVED agents only).\n\n    See also: `get_store_agent_details_as_admin()` which bypasses the","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/store/db.py#L360-L396","documentation":"NotFoundError raised by get_available_graph when no StoreListingVersion row matches the id AND isAvailable=true AND isDeleted=false, or the row exists but its AgentGraph relation is missing. It means the requested listing version is not publicly installable.","triggerScenarios":"Requesting a graph by store_listing_version_id that is misspelled, belongs to a version that was taken down (isAvailable=false), was soft-deleted, or whose parent graph was removed. Adding an agent from a stale store page whose version was superseded/unpublished also hits it.","commonSituations":"User keeps an old store page open and clicks 'add' after the version was unpublished; concurrent moderation taking a listing down mid-session; frontend caching version IDs past their validity; deleted test listings still referenced by bookmarks.","solutions":["Refresh the store listing to obtain the current store_listing_version_id and retry.","If you own the listing, check its moderation/availability state (isAvailable/isDeleted) in the creator dashboard.","Remove or refresh cached version IDs in the client instead of persisting them long-term.","Handle 404 with a user-facing 'this agent is no longer available' state."],"exampleFix":"// before — cached version id from an old page\nawait addAgent(cachedVersionId);\n// after — always resolve the current listing first\nconst listing = await getAgentDetails(username, slug);\nawait addAgent(listing.listing_version_id);","handlingStrategy":"validation","validationCode":"// Resolve the CURRENT version id before installing\nconst details = await getStoreAgentDetails(username, slug);\nif (!details?.listing_version_id) throw new Error('no available version');\nawait addAgentFromStore(details.listing_version_id);","typeGuard":"function isAvailableListing(v: { isAvailable?: boolean; isDeleted?: boolean }): boolean {\n  return v.isAvailable === true && v.isDeleted !== true;\n}","tryCatchPattern":"try { return await getAvailableGraph(versionId); }\ncatch (e) {\n  if (isNotFound(e)) { toast('This agent is no longer available'); return null; }\n  throw e;\n}","preventionTips":["Never persist store_listing_version_id beyond a session; refetch it from the listing.","Refresh store pages that have been open a long time before clicking 'add'.","Model 404 as a first-class UI state for marketplace items."],"tags":["store","not-found","http-404","listing-version"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}