{"record":{"id":"d650ed5a096ad3ac","repo":"mastra-ai/mastra","slug":"version-with-id-from-not-found-for-scorer-sco","errorCode":null,"errorMessage":"Version with id ${from} not found for scorer ${scorerId}","messagePattern":"Version with id (.+?) not found for scorer (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"packages/server/src/server/handlers/scorer-versions.ts","lineNumber":472,"sourceCode":"      const storage = mastra.getStorage();\n\n      if (!storage) {\n        throw new HTTPException(500, { message: 'Storage is not configured' });\n      }\n\n      const scorerStore = await storage.getStore('scorerDefinitions');\n      if (!scorerStore) {\n        throw new HTTPException(500, { message: 'Scorer definitions storage domain is not available' });\n      }\n      const scorer = await scorerStore.getById(scorerId);\n      assertStoredResourceScope(scorer, await getStoredResourceScope(mastra, requestContext));\n\n      const fromVersion = await scorerStore.getVersion(from);\n      if (!fromVersion) {\n        throw new HTTPException(404, { message: `Version with id ${from} not found` });\n      }\n      if (fromVersion.scorerDefinitionId !== scorerId) {\n        throw new HTTPException(404, {\n          message: `Version with id ${from} not found for scorer ${scorerId}`,\n        });\n      }\n\n      const toVersion = await scorerStore.getVersion(to);\n      if (!toVersion) {\n        throw new HTTPException(404, { message: `Version with id ${to} not found` });\n      }\n      if (toVersion.scorerDefinitionId !== scorerId) {\n        throw new HTTPException(404, {\n          message: `Version with id ${to} not found for scorer ${scorerId}`,\n        });\n      }\n\n      const fromConfig = extractConfigFromVersion(\n        fromVersion as unknown as Record<string, unknown>,\n        SNAPSHOT_CONFIG_FIELDS,\n      );","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/scorer-versions.ts#L454-L490","documentation":"Thrown when the `from` version exists in the scorer store but its `scorerDefinitionId` does not match the `scorerId` in the URL. The handler deliberately returns 404 (rather than 403/409) to avoid leaking version ids across scorer definitions. It prevents copying configuration from a version belonging to a different scorer.","triggerScenarios":"Calling the copy-config endpoint for scorer A while passing a `from` version id that belongs to scorer B.","commonSituations":"Mixing up version ids between two scorers configured in the same project; caching version ids per-project but requesting against a different scorer; copying an example payload that references another scorer's versions.","solutions":["Fetch versions scoped to the target scorerId and use one of those ids as `from`.","Verify the URL's scorerId matches the scorer that owns the `from` version.","If you intended a different scorer, change the scorerId in the request path instead."],"exampleFix":"// before\nconst from = otherScorerVersionId;\nawait copyConfig({ scorerId: 'my-scorer', from, to });\n// after\nconst versions = await getScorerVersions('my-scorer');\nconst from = versions.find(v => v.id === otherScorerVersionId)?.id ?? versions[0].id;\nawait copyConfig({ scorerId: 'my-scorer', from, to });","handlingStrategy":"validation","validationCode":"const versions = await getScorerVersions(scorerId);\nif (!versions.some(v => v.id === fromId)) throw new Error(`version ${fromId} does not belong to scorer ${scorerId}`);","typeGuard":null,"tryCatchPattern":"try {\n  await copyScorerVersionConfig({ scorerId, from, to });\n} catch (e) {\n  if (e instanceof MastraClientError && e.status === 404 && /for scorer/.test(e.message)) {\n    console.error('Version/scorer mismatch — re-resolve ids from the correct scorer.');\n  } else throw e;\n}","preventionTips":["Never reuse version ids across different scorers.","Fetch version ids scoped to the exact scorerId in the request path.","Tag cached ids with the scorerId they belong to."],"tags":["http-404","scorer-versions","ownership-mismatch"],"backgroundTag":"resource-not-found-404","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}