{"record":{"id":"e4c3bc3281a64d2c","repo":"mastra-ai/mastra","slug":"storage-is-not-configured-e4c3bc","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/scorer-versions.ts","lineNumber":59,"sourceCode":" * GET /stored/scorers/:scorerId/versions - List all versions for a scorer\n */\nexport const LIST_SCORER_VERSIONS_ROUTE = createRoute({\n  method: 'GET',\n  path: '/stored/scorers/:scorerId/versions',\n  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,","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/scorer-versions.ts#L41-L77","documentation":"This error is thrown by the GET scorer-versions list handler when the Mastra instance has no storage configured. Storage is a prerequisite for the scorer-definitions store, which is where scorer records and versions live. The library throws it as an HTTP 500 because the endpoint is fundamentally unable to serve any data without persistence.","triggerScenarios":"Calling GET /api/scorers/{scorerId}/versions (list scorer versions) on a Mastra server instance constructed without passing a storage option (Mastra({ storage }) omitted or set to undefined).","commonSituations":"Running the server in dev with an in-memory Mastra config and no storage adapter (LibSQL/PG/Upstash) configured; deploying after removing storage for a stateless agent-only setup; env var for the storage connection string missing so the storage factory returned undefined.","solutions":["Configure storage when constructing Mastra: new Mastra({ storage: new LibSQLStore({ url: process.env.LIBSQL_URL }) })","Verify the storage adapter package is installed and its constructor does not silently fail/return undefined","Check that env vars needed by the storage adapter are set in the server process environment","If the endpoint is intentionally unused, ensure clients do not call scorer-version routes on storage-less deployments"],"exampleFix":"// before\nnew Mastra({ agents: { myAgent } });\n// after\nimport { LibSQLStore } from '@mastra/libsql';\nnew Mastra({ agents: { myAgent }, storage: new LibSQLStore({ url: process.env.LIBSQL_URL }) });","handlingStrategy":"validation","validationCode":"const mastra = getMastra();\nif (!mastra.getStorage()) {\n  throw new Error('Mastra server requires storage for scorer version APIs');\n}","typeGuard":"function hasStorage(m: Mastra): boolean {\n  return typeof m.getStorage === 'function' && m.getStorage() != null;\n}","tryCatchPattern":"try {\n  const res = await fetch(`/api/scorers/${id}/versions`);\n  if (!res.ok) throw await res.json();\n} catch (e) {\n  if (e?.message === 'Storage is not configured') {\n    // configure storage / surface config error\n  }\n}","preventionTips":["Always pass a storage adapter in the Mastra constructor for server deployments","Add a startup assertion that mastra.getStorage() is truthy before listening","Keep storage config in one shared entrypoint used by dev and prod","Test server boot with env vars absent to fail fast on missing storage config"],"tags":["storage","server","configuration"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}