{"record":{"id":"a8f5390b0451bbbe","repo":"mastra-ai/mastra","slug":"scoresstorage-not-configured","errorCode":null,"errorMessage":"ScoresStorage not configured.","messagePattern":"ScoresStorage not configured\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/datasets/experiment/analytics/compare.ts","lineNumber":72,"sourceCode":" */\nexport async function compareExperiments(mastra: Mastra, config: CompareExperimentsConfig): Promise<ComparisonResult> {\n  const { experimentIdA, experimentIdB, thresholds = {} } = config;\n  const warnings: string[] = [];\n\n  // 1. Get storage\n  const storage = mastra.getStorage();\n  if (!storage) {\n    throw new Error('Storage not configured. Configure storage in Mastra instance.');\n  }\n\n  const experimentsStore = await storage.getStore('experiments');\n  const scoresStore = await storage.getStore('scores');\n\n  if (!experimentsStore) {\n    throw new Error('ExperimentsStorage not configured.');\n  }\n  if (!scoresStore) {\n    throw new Error('ScoresStorage not configured.');\n  }\n\n  // 2. Load both experiments\n  const [experimentA, experimentB] = await Promise.all([\n    experimentsStore.getExperimentById({ id: experimentIdA }),\n    experimentsStore.getExperimentById({ id: experimentIdB }),\n  ]);\n\n  if (!experimentA) {\n    throw new Error(`Experiment not found: ${experimentIdA}`);\n  }\n  if (!experimentB) {\n    throw new Error(`Experiment not found: ${experimentIdB}`);\n  }\n\n  // 3. Check version mismatch\n  const versionMismatch = experimentA.datasetVersion !== experimentB.datasetVersion;\n  if (versionMismatch) {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/datasets/experiment/analytics/compare.ts#L54-L90","documentation":"compareExperiments needs the scores store to read per-item scores for both experiments. The configured storage returned falsy for getStore('scores'), so score comparison cannot run even though experiments storage may be present.","triggerScenarios":"Calling compareExperiments when storage.getStore('scores') returns null/undefined — storage backend lacking scores support, domains not initialized, or an older/limited storage adapter.","commonSituations":"Storage adapter without scores domain; custom storage that implements experiments but not scores; storage schema migrations not run; experiments recorded elsewhere while the current storage has no scores table.","solutions":["Use a storage backend implementing the scores domain store, or upgrade the adapter","Run storage initialization/migrations so the scores domain is available","Verify getStore('scores') resolves before calling compareExperiments","Point Mastra at the storage instance that actually holds the experiment scores"],"exampleFix":"// before\nstorage: new ExperimentsOnlyStore() // scores missing\n// after\nstorage: new PgStore({ connectionString: process.env.DATABASE_URL }) // full domains incl. scores","handlingStrategy":"validation","validationCode":"const storage = mastra.getStorage();\nif (!storage || !(await storage.getStore('scores'))) throw new Error('Storage backend does not provide a scores store');","typeGuard":"function hasScoresStore(s) { return s != null && typeof s.getStore === 'function'; } // then await s.getStore('scores') and check non-null","tryCatchPattern":"try {\n  const report = await compareExperiments({ mastra, config });\n} catch (e) {\n  if (e instanceof Error && /ScoresStorage not configured/i.test(e.message)) {\n    // switch to full-featured storage with scores support\n  } else throw e;\n}","preventionTips":["Verify both experiments and scores domains before analytics calls","Use storage adapters with full domain coverage for eval workflows","Add a startup check that resolves getStore('scores') and getStore('experiments')"],"tags":["storage","configuration","experiments","analytics","scores"],"backgroundTag":"storage-domain-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}