{"record":{"id":"b03d133c9a586fd7","repo":"mastra-ai/mastra","slug":"prompt-blocks-storage-domain-is-not-available-b03d13","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":"error","filePath":"packages/server/src/server/handlers/stored-prompt-blocks.ts","lineNumber":64,"sourceCode":"  path: '/stored/prompt-blocks',\n  responseType: 'json',\n  queryParamSchema: listStoredPromptBlocksQuerySchema,\n  responseSchema: listStoredPromptBlocksResponseSchema,\n  summary: 'List stored prompt blocks',\n  description: 'Returns a paginated list of all prompt blocks stored in the database',\n  tags: ['Stored Prompt Blocks'],\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 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 scope = await getStoredResourceScope(mastra, requestContext);\n      const result = await promptBlockStore.listResolved({\n        page,\n        perPage,\n        orderBy,\n        status,\n        authorId,\n        metadata: scopeStoredResourceMetadata(metadata, scope),\n      });\n\n      // For each block, fetch the latest version to compute hasDraft.\n      // resolvedVersionId from listResolved defaults to 'published' resolution,\n      // so we need the actual latest version to detect unpublished drafts.\n      const promptBlocks = await Promise.all(\n        result.promptBlocks.map(async (block: (typeof result.promptBlocks)[number]) => {\n          const latestVersion = await promptBlockStore.getLatestVersion(block.id);","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/stored-prompt-blocks.ts#L46-L82","documentation":"Storage exists but getStore('promptBlocks') returned null, meaning the configured storage adapter does not provide the promptBlocks domain. The server throws HTTP 500 because it cannot enumerate prompt blocks without that domain store.","triggerScenarios":"GET stored prompt blocks list against an adapter without promptBlocks support — usually version skew between @mastra/core server code and the installed storage package, or a custom storage implementation missing this newer domain.","commonSituations":"Recently added feature used with an older storage package; third-party adapters that implement only legacy domains; partial upgrades in a pnpm workspace where core updated but adapters pinned.","solutions":["Update the storage adapter and @mastra/core to the same latest version (pnpm why / lockfile check for skew)","If custom, implement the promptBlocks domain in your storage class","Verify with a script: const s = mastra.getStorage(); await s.getStore('promptBlocks') should be truthy","Switch to an official adapter (libsql, pg, upstash) that ships all current domains"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const store = await mastra.getStorage()?.getStore('promptBlocks');\nif (!store) throw new Error('promptBlocks domain missing from storage adapter — upgrade adapter');","typeGuard":null,"tryCatchPattern":"try {\n  const blocks = await store.listResolved({ page, perPage });\n} catch (e) {\n  if (/storage domain is not available/.test(String(e))) {\n    // version skew: upgrade @mastra/core + storage adapter together\n  }\n}","preventionTips":["Upgrade core and adapter packages together","Check adapter release notes for promptBlocks support","Smoke-test each storage domain at startup","Avoid third-party adapters lacking newer domains"],"tags":["http-500","storage","prompt-blocks","version-skew"],"backgroundTag":"storage-domain-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}