{"record":{"id":"50f13f5748971e77","repo":"mastra-ai/mastra","slug":"storage-is-not-configured-50f13f","errorCode":null,"errorMessage":"Storage is not configured","messagePattern":"Storage is not configured","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"packages/server/src/server/handlers/stored-scorers.ts","lineNumber":54,"sourceCode":"/**\n * GET /stored/scorers - List all stored scorer definitions\n */\nexport const LIST_STORED_SCORERS_ROUTE = createRoute({\n  method: 'GET',\n  path: '/stored/scorers',\n  responseType: 'json',\n  queryParamSchema: listStoredScorersQuerySchema,\n  responseSchema: listStoredScorersResponseSchema,\n  summary: 'List stored scorer definitions',\n  description: 'Returns a paginated list of all scorer definitions stored in the database',\n  tags: ['Stored Scorers'],\n  requiresAuth: true,\n  handler: async ({ mastra, page, perPage, orderBy, status, authorId, metadata, 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 scope = await getStoredResourceScope(mastra, requestContext);\n      const result = await scorerStore.listResolved({\n        page,\n        perPage,\n        orderBy,\n        status,\n        authorId,\n        metadata: scopeStoredResourceMetadata(metadata, scope),\n      });\n\n      return result;","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/stored-scorers.ts#L36-L72","documentation":"The list stored scorers handler calls `mastra.getStorage()` and throws HTTP 500 when it returns undefined. Mastra server routes that read persisted data require a storage adapter to be configured on the Mastra instance; without one there is nowhere to read scorer definitions from.","triggerScenarios":"GET request to the stored scorers list endpoint on a Mastra instance constructed without a `storage` option — e.g. `new Mastra({ agents })` with no storage adapter, or storage intentionally omitted in a stateless deployment.","commonSituations":"Fresh project following agent-only quickstart (no storage configured) then opening Studio scorers page; storage removed during a refactor; running the server against an in-memory-only setup that lacks persistent storage.","solutions":["Configure a storage adapter on the Mastra instance, e.g. `new Mastra({ storage: new MastraStorage(...) })` or the Postgres/Upstress/LibSQL adapter of your choice.","If using @mastra/core with a deployer, set the storage via env-backed config so the served instance has it.","Restart the server after adding storage and confirm the Studio scorers page loads."],"exampleFix":"// before\nnew Mastra({ agents: { myAgent } });\n\n// after\nimport { Mastra } from '@mastra/core';\nimport { PostgresStore } from '@mastra/pg';\nnew Mastra({ agents: { myAgent }, storage: new PostgresStore({ connectionString: process.env.DATABASE_URL }) });","handlingStrategy":"validation","validationCode":"if (!mastra.getStorage()) {\n  throw new Error('Mastra storage is not configured; scorers endpoints are unavailable.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const res = await fetch('/api/stored-scorers');\n  if (!res.ok) throw new Error(await res.text());\n} catch (e) {\n  console.error('Storage misconfiguration on server:', e);\n}","preventionTips":["Always pass a storage adapter when constructing Mastra in any server that exposes scorers APIs","Add a startup check that getStorage() returns a store before serving traffic","Keep storage config in one env-driven module so it can't be dropped per environment"],"tags":["configuration","storage","http-500","server"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}