mastra-ai/mastra · error · MastraError

EXPERIMENTS_STORE_NOT_AVAILABLE

EXPERIMENTS_STORE_NOT_AVAILABLE

Error message

Experiments store not available. Ensure your storage adapter provides an experiments domain.

What it means

Storage is configured but getStore('experiments') yields no experiments domain store, so #getExperimentsStore throws EXPERIMENTS_STORE_NOT_AVAILABLE. This indicates the storage backend lacks experiment support specifically (as opposed to no storage at all).

Source

Thrown at packages/core/src/datasets/manager.ts:88

    return store;
  }

  async #getExperimentsStore(): Promise<ExperimentsStorage> {
    if (this.#experimentsStore) return this.#experimentsStore;

    const storage = this.#mastra.getStorage();
    if (!storage) {
      throw new MastraError({
        id: 'DATASETS_STORAGE_NOT_CONFIGURED',
        text: 'Storage not configured. Configure storage in Mastra instance.',
        domain: 'STORAGE',
        category: 'USER',
      });
    }

    const store = await storage.getStore('experiments');
    if (!store) {
      throw new MastraError({
        id: 'EXPERIMENTS_STORE_NOT_AVAILABLE',
        text: 'Experiments store not available. Ensure your storage adapter provides an experiments domain.',
        domain: 'STORAGE',
        category: 'USER',
      });
    }

    this.#experimentsStore = store;
    return store;
  }

  // ---------------------------------------------------------------------------
  // Dataset CRUD
  // ---------------------------------------------------------------------------

  /**
   * Create a new dataset.
   *

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Upgrade the storage adapter to a release implementing the experiments domain.
  2. Switch to an official adapter with full experiments support.
  3. Implement the experiments domain in your custom storage adapter.
  4. Probe at boot: const s = await storage.getStore('experiments'); if (!s) fail fast with a clear message.

Example fix

// before
storage: new MinimalStore() // no experiments domain
// after
storage: new LibSQLStore({ url: process.env.DATABASE_URL })
Defensive patterns

Strategy: validation

Validate before calling

const store = await mastra.getStorage()?.getStore('experiments');
if (!store) throw new Error('Storage adapter lacks experiments domain; upgrade or switch adapter');

Type guard

async function experimentsSupported(m: Mastra): Promise<boolean> {
  return !!(await m.getStorage()?.getStore('experiments'));
}

Try / catch

try {
  await experiments.list({});
} catch (err) {
  if (err?.id === 'EXPERIMENTS_STORE_NOT_AVAILABLE') {
    logger.error('Storage adapter does not implement the experiments domain');
  }
  throw err;
}

Prevention

When it happens

Trigger: Adapter without the experiments domain; version mismatch where core expects an experiments store the installed adapter doesn't provide; custom adapter missing the experiments capability registration.

Common situations: Partial domain support in third-party storage adapters; upgrading core for experiments while storage package lags behind; minimal dev adapters.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/25894fe408ac9f77. Report an issue: GitHub.