{"record":{"id":"0099ae85b678748c","repo":"mastra-ai/mastra","slug":"version-with-id-from-not-found-0099ae","errorCode":null,"errorMessage":"Version with id ${from} not found","messagePattern":"Version with id (.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"packages/server/src/server/handlers/mcp-client-versions.ts","lineNumber":465,"sourceCode":"  tags: ['MCP Client Versions'],\n  handler: async ({ mastra, mcpClientId, from, to, requestContext }) => {\n    try {\n      const storage = mastra.getStorage();\n\n      if (!storage) {\n        throw new HTTPException(500, { message: 'Storage is not configured' });\n      }\n\n      const mcpClientStore = await storage.getStore('mcpClients');\n      if (!mcpClientStore) {\n        throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n      }\n      const mcpClient = await mcpClientStore.getById(mcpClientId);\n      assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n      const fromVersion = await mcpClientStore.getVersion(from);\n      if (!fromVersion) {\n        throw new HTTPException(404, { message: `Version with id ${from} not found` });\n      }\n      if (fromVersion.mcpClientId !== mcpClientId) {\n        throw new HTTPException(404, {\n          message: `Version with id ${from} not found for MCP client ${mcpClientId}`,\n        });\n      }\n\n      const toVersion = await mcpClientStore.getVersion(to);\n      if (!toVersion) {\n        throw new HTTPException(404, { message: `Version with id ${to} not found` });\n      }\n      if (toVersion.mcpClientId !== mcpClientId) {\n        throw new HTTPException(404, {\n          message: `Version with id ${to} not found for MCP client ${mcpClientId}`,\n        });\n      }\n\n      const fromConfig = extractConfigFromVersion(","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/mcp-client-versions.ts#L447-L483","documentation":"The compare handler resolves the 'from' version via mcpClientStore.getVersion(from); if the store returns nothing it throws HTTPException 404. It means no version with that id exists for comparison.","triggerScenarios":"GET /stored/mcp-clients/:mcpClientId/versions/compare?from=<id>&to=<id> where the from id is missing from storage (deleted, wrong backend, typo).","commonSituations":"Comparing against a version that was already cleaned up; stale links/bookmarks in the UI; querying a storage instance different from where versions were created.","solutions":["List the client's versions (GET /stored/mcp-clients/:id/versions) and pick a valid from id.","Correct the query parameter value; ensure both from and to exist.","Check you're pointing at the same storage backend used when the versions were recorded."],"exampleFix":"// before\nfetch(`/api/stored/mcp-clients/${id}/versions/compare?from=${deletedId}&to=${toId}`)\n// after\nconst { versions } = await (await fetch(`/api/stored/mcp-clients/${id}/versions`)).json();\nconst from = versions.find(v => v.versionNumber === 2)?.id;\nfetch(`/api/stored/mcp-clients/${id}/versions/compare?from=${from}&to=${toId}`)","handlingStrategy":"validation","validationCode":"const { versions } = await (await fetch(`/api/stored/mcp-clients/${clientId}/versions`)).json();\nif (!versions.some(v => v.id === fromId)) throw new Error(`from version ${fromId} not found`);","typeGuard":null,"tryCatchPattern":"try { await compare(from, to); } catch (e) { if (e.status === 404) { const fresh = await listVersions(); /* retry with valid ids */ } else throw e; }","preventionTips":["Resolve from/to ids from the live versions list, not cached values","Refresh version lists after any delete/restore operation","Validate both ids client-side before calling compare"],"tags":["http-404","storage","versioning","query-params"],"backgroundTag":"resource-not-found-404","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}