mastra-ai/mastra · error · HTTPException
Scorer definitions storage domain is not available
Error message
Scorer definitions storage domain is not available
What it means
Thrown when storage is configured but the 'scorerDefinitions' domain store is unavailable via storage.getStore('scorerDefinitions'). This means the configured storage adapter either does not implement the scorer-definitions domain or its store failed to initialize. It surfaces as HTTP 500 because the handler cannot proceed without the domain store.
Source
Thrown at packages/server/src/server/handlers/scorer-versions.ts:64
requiresAuth: true,
responseType: 'json',
pathParamSchema: scorerVersionPathParams,
queryParamSchema: listScorerVersionsQuerySchema,
responseSchema: listScorerVersionsResponseSchema,
summary: 'List scorer versions',
description: 'Returns a paginated list of all versions for a stored scorer',
tags: ['Scorer Versions'],
handler: async ({ mastra, scorerId, page, perPage, orderBy, requestContext }) => {
try {
const storage = mastra.getStorage();
if (!storage) {
throw new HTTPException(500, { message: 'Storage is not configured' });
}
const scorerStore = await storage.getStore('scorerDefinitions');
if (!scorerStore) {
throw new HTTPException(500, { message: 'Scorer definitions storage domain is not available' });
}
const scorer = await scorerStore.getById(scorerId);
if (!scorer) {
throw new HTTPException(404, { message: `Scorer with id ${scorerId} not found` });
}
assertStoredResourceScope(scorer, await getStoredResourceScope(mastra, requestContext));
const result = await scorerStore.listVersions({
scorerDefinitionId: scorerId,
page,
perPage,
orderBy,
});
return result;
} catch (error) {
return handleError(error, 'Error listing scorer versions');View on GitHub (pinned to 75dd419e61)
Solutions
- Upgrade the storage adapter package to a version that implements the scorerDefinitions domain store
- If using custom storage, implement/return a store for the 'scorerDefinitions' domain in getStore
- Run any pending storage migrations/init so all domain tables are created
- Switch to a supported adapter (LibSQLStore, PgStore, UpstashStore) from a current release
Example fix
// before (custom storage)
async getStore(domain: StorageDomains) { if (domain === 'scorerDefinitions') return null; ... }
// after
async getStore(domain: StorageDomains) { if (domain === 'scorerDefinitions') return this.scorerDefinitionsStore; ... } Defensive patterns
Strategy: validation
Validate before calling
const storage = mastra.getStorage();
if (!storage || !(await storage.getStore('scorerDefinitions'))) {
throw new Error('Storage adapter does not support scorerDefinitions domain');
} Type guard
async function supportsScorerDefs(s: MastraStorage): Promise<boolean> {
return (await s.getStore('scorerDefinitions')) != null;
} Try / catch
try {
await createScorerVersion(id, payload);
} catch (e) {
if (e?.message?.includes('storage domain is not available')) {
// upgrade/implement the storage adapter
}
throw e;
} Prevention
- Keep @mastra/core and storage adapter versions aligned in package.json
- Prefer first-party adapters (LibSQL/Pg/Upstash) over partial custom implementations
- Run storage init/migrations at server startup and log per-domain availability
- Add an integration test asserting getStore('scorerDefinitions') is non-null
When it happens
Trigger: Any scorer-version route (list, create version, get version) when mastra.getStorage() returns an object whose getStore('scorerDefinitions') resolves to null/undefined — e.g. an old storage adapter without scorer support, or a custom storage implementation that does not register the scorerDefinitions domain.
Common situations: Using an outdated @mastra/libsql/@mastra/pg version that predates scorer-definition stores; implementing a custom MastraStorage subclass without overriding the scorerDefinitions store; a storage migration step that did not run so the store is not provisioned.
Related errors
- AcpAgent does not support resuming suspended generate calls
- AcpAgent does not support resuming suspended stream calls
- ACP prompt stopped before completing: ${response.stopReason}
- ClaudeSDKAgent resumeData must include a message.
- Agents storage domain is not available
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/4ba8047d6a583885.
Report an issue: GitHub.