{"record":{"id":"3ffd962b4253d345","repo":"mastra-ai/mastra","slug":"mastra-scores-storage-not-available","errorCode":"MASTRA_SCORES_STORAGE_NOT_AVAILABLE","errorMessage":"Scores storage domain is not available","messagePattern":"Scores storage domain is not available","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/evals/scoreTraces/scoreTracesWorkflow.ts","lineNumber":379,"sourceCode":"\n  const scoredCount = results.filter(result => result.ok).length;\n\n  return {\n    ...(batchId ? { batchId } : {}),\n    ...(datasetId ? { datasetId } : {}),\n    scoredCount,\n    failedCount: results.length - scoredCount,\n    results,\n  };\n}\n\n/**\n * @deprecated Legacy scores-store path. New score emission should use `mastra.observability.addScore()`.\n */\nasync function validateAndSaveScore({ storage, scorerResult }: { storage: MastraStorage; scorerResult: ScorerRun }) {\n  const scoresStore = await storage.getStore('scores');\n  if (!scoresStore) {\n    throw new MastraError({\n      id: 'MASTRA_SCORES_STORAGE_NOT_AVAILABLE',\n      domain: ErrorDomain.STORAGE,\n      category: ErrorCategory.SYSTEM,\n      text: 'Scores storage domain is not available',\n    });\n  }\n  const payloadToSave = saveScorePayloadSchema.parse(scorerResult);\n  const result = await scoresStore.saveScore(payloadToSave);\n  return result.score;\n}\n\nfunction buildScorerRun({\n  scorerType,\n  trace,\n  targetSpan,\n}: {\n  scorerType?: string;\n  trace: TraceRecord;","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/evals/scoreTraces/scoreTracesWorkflow.ts#L361-L397","documentation":"This MastraError is thrown by the deprecated legacy scores-save path in scoreTracesWorkflow when the storage adapter cannot provide a 'scores' domain store. MastraStorage is domain-modular: `storage.getStore('scores')` returns null when the configured storage class does not implement the scores domain. The workflow aborts instead of silently dropping the score record.","triggerScenarios":"Calling the legacy score-traces workflow (validateAndSaveScore, invoked by savedScoreRecord) with a storage instance whose class does not implement the scores store domain — e.g. a minimal/custom MastraStorage implementation or an older adapter lacking scores support.","commonSituations":"Using a custom or third-party storage adapter that predates or omits the scores domain; upgrading @mastra/core but not the storage package; selecting an in-memory/minimal storage for local runs while running scoring workflows.","solutions":["Use a supported storage adapter that implements the scores domain (e.g. current @mastra/libsql, @mastra/pg, @mastra/upstash) and pass it to Mastra","Upgrade the storage package to a version matching @mastra/core so getStore('scores') is supported","Migrate score emission to `mastra.observability.addScore()`, which is the recommended path and replaces this deprecated workflow"],"exampleFix":"// before\nnew Mastra({ storage: new MinimalStorage() });\n// after\nimport { LibSQLStore } from '@mastra/libsql';\nnew Mastra({ storage: new LibSQLStore({ url: 'file:./mastra.db' }) });","handlingStrategy":"validation","validationCode":"const scoresStore = await storage.getStore('scores');\nif (!scoresStore) {\n  throw new Error('Storage adapter does not support the scores domain; use a full adapter (e.g. @mastra/libsql/@mastra/pg) or mastra.observability.addScore().');\n}","typeGuard":"function hasScoresStore(s: MastraStorage | undefined): s is MastraStorage & { getStore: (d: 'scores') => Promise<object> } {\n  return !!s && typeof s.getStore === 'function';\n}","tryCatchPattern":"try {\n  await runScoreTracesWorkflow(...);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'MASTRA_SCORES_STORAGE_NOT_AVAILABLE') {\n    logger.warn('Scores storage unavailable; falling back to observability.addScore()');\n  } else throw e;\n}","preventionTips":["Use officially supported storage adapters that implement all domains","Keep @mastra/core and the storage package versions in lockstep","Prefer mastra.observability.addScore() over the deprecated scores-store path","Smoke-test storage domain availability at startup (await storage.getStore('scores'))"],"tags":["storage","scores","deprecated","mastra-error"],"backgroundTag":"storage-domain-not-available","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}