{"record":{"id":"682868851d6faee1","repo":"mastra-ai/mastra","slug":"experiments-storage-not-configured","errorCode":"EXPERIMENTS_STORAGE_NOT_CONFIGURED","errorMessage":"ExperimentsStorage not configured. Configure storage in the Mastra instance.","messagePattern":"ExperimentsStorage not configured\\. Configure storage in the Mastra instance\\.","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/datasets/experiment/item.ts","lineNumber":121,"sourceCode":"    const resolution = await createItemScorerResolver(mastra)(item.scorerIds);\n    scorers = resolution.scorers;\n    if (resolution.missingIds.length > 0) {\n      scorerConfigError = {\n        code: EXPERIMENT_ITEM_SCORER_NOT_FOUND,\n        message: `Item scorer configuration references unregistered scorer IDs: ${resolution.missingIds.join(', ')}`,\n      };\n    }\n  } else {\n    scorers = resolveScorers(mastra, [...new Set(args.datasetScorerIds ?? [])]);\n  }\n\n  // Resolve the experiments store before executing the target so a\n  // misconfigured storage layer fails fast, before the target is billed or\n  // any score rows are written.\n  const storage = mastra.getStorage();\n  const experimentsStore = await storage?.getStore('experiments');\n  if (!experimentsStore) {\n    throw new MastraError({\n      id: 'EXPERIMENTS_STORAGE_NOT_CONFIGURED',\n      text: 'ExperimentsStorage not configured. Configure storage in the Mastra instance.',\n      domain: 'STORAGE',\n      category: 'USER',\n    });\n  }\n\n  const startedAt = new Date();\n\n  const mergedRequestContext =\n    args.requestContext || item.requestContext ? { ...args.requestContext, ...item.requestContext } : undefined;\n\n  const execResult: ExecutionResult = scorerConfigError\n    ? { output: null, error: scorerConfigError, traceId: null }\n    : await executeTarget(resolved.target, experiment.targetType, item, {\n        requestContext: mergedRequestContext,\n        experimentId: experiment.id,\n      });","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/datasets/experiment/item.ts#L103-L139","documentation":"executeExperimentItem needs the experiments storage domain to persist item status and scores, and resolves it BEFORE executing the target so misconfiguration fails fast before billing or score writes. If mastra.getStorage() returns no storage or storage.getStore('experiments') returns undefined, it throws EXPERIMENTS_STORAGE_NOT_CONFIGURED.","triggerScenarios":"Running an experiment with a Mastra instance constructed without storage; storage configured but the adapter does not implement the experiments domain store.","commonSituations":"Evaluating in-memory/test Mastra instances with no storage; using a storage adapter that predates the experiments domain; forgetting `storage:` in new Mastra({...}) for server-side experiment runs.","solutions":["Configure storage: new Mastra({ storage: new MastraStorage(...) }) with an adapter that supports the experiments domain.","Upgrade your storage adapter package to a version providing the experiments store.","In tests, either configure an in-memory storage or skip local execution in favor of submitExperimentResult.","Pre-flight check: (await mastra.getStorage()?.getStore('experiments')) before starting runs."],"exampleFix":"// before\nnew Mastra({ agents: { myAgent } })\n// after\nnew Mastra({ agents: { myAgent }, storage: new LibSQLStore({ url: process.env.DATABASE_URL }) })","handlingStrategy":"validation","validationCode":"const store = await mastra.getStorage()?.getStore('experiments');\nif (!store) throw new Error('Configure storage with an experiments domain before running experiments');","typeGuard":"async function hasExperimentsStore(m: Mastra): Promise<boolean> {\n  return !!(await m.getStorage()?.getStore('experiments'));\n}","tryCatchPattern":"try {\n  await runExperimentItem({ mastra, experiment, item });\n} catch (err) {\n  if (err?.id === 'EXPERIMENTS_STORAGE_NOT_CONFIGURED') {\n    logger.error('Add storage: new Mastra({ storage }) with experiments domain support');\n  }\n  throw err;\n}","preventionTips":["Configure storage in every environment where experiments run, including tests.","Add a startup check that the experiments store resolves before serving traffic.","Keep the storage adapter at a version matching @mastra/core feature set.","Fail fast at bootstrap rather than at first experiment execution."],"tags":["storage","configuration","experiments"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}