mastra-ai/mastra · error · MastraError

OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED

OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED

Error message

This storage provider does not support creating scores

What it means

MastraError OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED. createScore in the observability storage base class is a stub that unconditionally throws, so writing a single score record to a provider that has not implemented score persistence produces this error. It marks score storage as an unimplemented capability.

Source

Thrown at packages/core/src/storage/domains/observability/base.ts:569

  async getTags(_args: GetTagsArgs): Promise<GetTagsResponse> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_GET_TAGS_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support tag discovery',
    });
  }

  // ============================================================================
  // Scores
  // ============================================================================

  /**
   * Creates a single score record.
   */
  async createScore(_args: CreateScoreArgs): Promise<void> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support creating scores',
    });
  }

  /**
   * Creates multiple score observations in a single batch.
   */
  async batchCreateScores(_args: BatchCreateScoresArgs): Promise<void> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_BATCH_CREATE_SCORES_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support batch creating scores',
    });
  }

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Use a storage provider that implements score persistence (e.g. Postgres/Upstash observability stores)
  2. Override createScore in your storage domain to persist score records
  3. Gate scoring runs on a capability check or catch the error and skip/queue score writes

Example fix

// before
await storage.createScore(score);
// after
try {
  await storage.createScore(score);
} catch (e) {
  if (e.id === 'OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED') {
    console.warn('Score storage not supported by provider; skipping score');
    return;
  }
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

async function supportsScoreWrites(storage) {
  try { await storage.createScore(sampleScore); return true; }
  catch (e) { return e?.id !== 'OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED'; }
}

Type guard

function isNotImplementedError(e: unknown): e is MastraError {
  return e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED';
}

Try / catch

try {
  await storage.createScore(score);
} catch (e) {
  if (isNotImplementedError(e)) {
    logger.warn('Storage provider does not support scores; dropping score', { score });
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling createScore(args) (directly or via scoring pipeline) on a storage class that extends the base without overriding createScore.

Common situations: Scoring agents/workflows while using a storage adapter without score support; in-memory or dev storage in production scoring flows; custom adapters implementing queries but not score writes.

Related errors


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