mastra-ai/mastra · error · Error
ScoresStorage not configured.
Error message
ScoresStorage not configured.
What it means
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.
Source
Thrown at packages/core/src/datasets/experiment/analytics/compare.ts:72
*/
export async function compareExperiments(mastra: Mastra, config: CompareExperimentsConfig): Promise<ComparisonResult> {
const { experimentIdA, experimentIdB, thresholds = {} } = config;
const warnings: string[] = [];
// 1. Get storage
const storage = mastra.getStorage();
if (!storage) {
throw new Error('Storage not configured. Configure storage in Mastra instance.');
}
const experimentsStore = await storage.getStore('experiments');
const scoresStore = await storage.getStore('scores');
if (!experimentsStore) {
throw new Error('ExperimentsStorage not configured.');
}
if (!scoresStore) {
throw new Error('ScoresStorage not configured.');
}
// 2. Load both experiments
const [experimentA, experimentB] = await Promise.all([
experimentsStore.getExperimentById({ id: experimentIdA }),
experimentsStore.getExperimentById({ id: experimentIdB }),
]);
if (!experimentA) {
throw new Error(`Experiment not found: ${experimentIdA}`);
}
if (!experimentB) {
throw new Error(`Experiment not found: ${experimentIdB}`);
}
// 3. Check version mismatch
const versionMismatch = experimentA.datasetVersion !== experimentB.datasetVersion;
if (versionMismatch) {View on GitHub (pinned to 75dd419e61)
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
Example fix
// before
storage: new ExperimentsOnlyStore() // scores missing
// after
storage: new PgStore({ connectionString: process.env.DATABASE_URL }) // full domains incl. scores Defensive patterns
Strategy: validation
Validate before calling
const storage = mastra.getStorage();
if (!storage || !(await storage.getStore('scores'))) throw new Error('Storage backend does not provide a scores store'); Type guard
function hasScoresStore(s) { return s != null && typeof s.getStore === 'function'; } // then await s.getStore('scores') and check non-null Try / catch
try {
const report = await compareExperiments({ mastra, config });
} catch (e) {
if (e instanceof Error && /ScoresStorage not configured/i.test(e.message)) {
// switch to full-featured storage with scores support
} else throw e;
} Prevention
- 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')
When it happens
Trigger: Calling compareExperiments when storage.getStore('scores') returns null/undefined — storage backend lacking scores support, domains not initialized, or an older/limited storage adapter.
Common situations: 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.
Related errors
- Storage not configured. Configure storage in Mastra instance
- ExperimentsStorage not configured.
- EXPERIMENTS_STORAGE_NOT_CONFIGURED
- Storage not configured
- Experiments storage not available
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/a8f5390b0451bbbe.
Report an issue: GitHub.