{"record":{"id":"4ba8047d6a583885","repo":"mastra-ai/mastra","slug":"scorer-definitions-storage-domain-is-not-available","errorCode":null,"errorMessage":"Scorer definitions storage domain is not available","messagePattern":"Scorer definitions storage domain is not available","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"packages/server/src/server/handlers/scorer-versions.ts","lineNumber":64,"sourceCode":"  requiresAuth: true,\n  responseType: 'json',\n  pathParamSchema: scorerVersionPathParams,\n  queryParamSchema: listScorerVersionsQuerySchema,\n  responseSchema: listScorerVersionsResponseSchema,\n  summary: 'List scorer versions',\n  description: 'Returns a paginated list of all versions for a stored scorer',\n  tags: ['Scorer Versions'],\n  handler: async ({ mastra, scorerId, page, perPage, orderBy, requestContext }) => {\n    try {\n      const storage = mastra.getStorage();\n\n      if (!storage) {\n        throw new HTTPException(500, { message: 'Storage is not configured' });\n      }\n\n      const scorerStore = await storage.getStore('scorerDefinitions');\n      if (!scorerStore) {\n        throw new HTTPException(500, { message: 'Scorer definitions storage domain is not available' });\n      }\n\n      const scorer = await scorerStore.getById(scorerId);\n      if (!scorer) {\n        throw new HTTPException(404, { message: `Scorer with id ${scorerId} not found` });\n      }\n      assertStoredResourceScope(scorer, await getStoredResourceScope(mastra, requestContext));\n\n      const result = await scorerStore.listVersions({\n        scorerDefinitionId: scorerId,\n        page,\n        perPage,\n        orderBy,\n      });\n\n      return result;\n    } catch (error) {\n      return handleError(error, 'Error listing scorer versions');","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/scorer-versions.ts#L46-L82","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (custom storage)\nasync getStore(domain: StorageDomains) { if (domain === 'scorerDefinitions') return null; ... }\n// after\nasync getStore(domain: StorageDomains) { if (domain === 'scorerDefinitions') return this.scorerDefinitionsStore; ... }","handlingStrategy":"validation","validationCode":"const storage = mastra.getStorage();\nif (!storage || !(await storage.getStore('scorerDefinitions'))) {\n  throw new Error('Storage adapter does not support scorerDefinitions domain');\n}","typeGuard":"async function supportsScorerDefs(s: MastraStorage): Promise<boolean> {\n  return (await s.getStore('scorerDefinitions')) != null;\n}","tryCatchPattern":"try {\n  await createScorerVersion(id, payload);\n} catch (e) {\n  if (e?.message?.includes('storage domain is not available')) {\n    // upgrade/implement the storage adapter\n  }\n  throw e;\n}","preventionTips":["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"],"tags":["storage","server","storage-adapter"],"backgroundTag":"storage-domain-unavailable","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}