{"record":{"id":"95c32cf3fe2cb916","repo":"mastra-ai/mastra","slug":"prompt-blocks-storage-domain-is-not-available","errorCode":null,"errorMessage":"Prompt blocks storage domain is not available","messagePattern":"Prompt blocks storage domain is not available","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"critical","filePath":"packages/server/src/server/handlers/prompt-block-versions.ts","lineNumber":55,"sourceCode":"  requiresAuth: true,\n  responseType: 'json',\n  pathParamSchema: promptBlockVersionPathParams,\n  queryParamSchema: listPromptBlockVersionsQuerySchema,\n  responseSchema: listPromptBlockVersionsResponseSchema,\n  summary: 'List prompt block versions',\n  description: 'Returns a paginated list of all versions for a stored prompt block',\n  tags: ['Prompt Block Versions'],\n  handler: async ({ mastra, promptBlockId, 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 promptBlockStore = await storage.getStore('promptBlocks');\n      if (!promptBlockStore) {\n        throw new HTTPException(500, { message: 'Prompt blocks storage domain is not available' });\n      }\n\n      const promptBlock = await promptBlockStore.getById(promptBlockId);\n      if (!promptBlock) {\n        throw new HTTPException(404, { message: `Prompt block with id ${promptBlockId} not found` });\n      }\n      assertStoredResourceScope(promptBlock, await getStoredResourceScope(mastra, requestContext));\n\n      const result = await promptBlockStore.listVersions({\n        blockId: promptBlockId,\n        page,\n        perPage,\n        orderBy,\n      });\n\n      return result;\n    } catch (error) {\n      return handleError(error, 'Error listing prompt block versions');","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/prompt-block-versions.ts#L37-L73","documentation":"Storage exists but does not expose the 'promptBlocks' domain store: storage.getStore('promptBlocks') returned undefined, so the handler throws HTTP 500. Some storage adapters implement only a subset of Mastra's storage domains.","triggerScenarios":"Calling the prompt-block versions route with a storage adapter that has not implemented the promptBlocks store (getStore('promptBlocks') === undefined).","commonSituations":"Using a minimal or older storage adapter lacking newer domains; custom MastraStorage implementations that skipped promptBlocks; version skew between @mastra/core and the storage package.","solutions":["Upgrade the storage package to a version implementing the promptBlocks domain.","Switch to a fully featured adapter (e.g. LibSQL/Postgres storage) that supports promptBlocks.","If using a custom storage class, implement the promptBlocks store methods (getById, listVersions, etc.)."],"exampleFix":"// before\nstorage: new MastraMemoryStorage() // no promptBlocks domain\n// after\nstorage: new MastraLibsql({ url: 'file:./mastra.db' }) // implements all domains incl. promptBlocks","handlingStrategy":"try-catch","validationCode":"const storage = mastra.getStorage();\nif (storage && !(await storage.getStore('promptBlocks'))) {\n  throw new Error('Storage adapter does not implement the promptBlocks domain');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await client.getPromptBlockVersions(id);\n} catch (e) {\n  if (e.status === 500 && e.message.includes('storage domain is not available')) {\n    console.error('Upgrade/swap the storage adapter to one implementing promptBlocks');\n    return;\n  }\n  throw e;\n}","preventionTips":["Pin @mastra/core and the storage package to compatible versions.","Prefer first-party adapters (LibSQL/Postgres/Upstash) that implement all storage domains.","If writing a custom storage adapter, implement every domain Mastra features require."],"tags":["http-500","storage","storage-domain"],"backgroundTag":"storage-domain-unavailable","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}