{"record":{"id":"03fe9b1bb7877787","repo":"mastra-ai/mastra","slug":"workspaces-storage-domain-is-not-available","errorCode":null,"errorMessage":"Workspaces storage domain is not available","messagePattern":"Workspaces storage domain is not available","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"packages/server/src/server/handlers/stored-workspaces.ts","lineNumber":52,"sourceCode":"  path: '/stored/workspaces',\n  responseType: 'json',\n  queryParamSchema: listStoredWorkspacesQuerySchema,\n  responseSchema: listStoredWorkspacesResponseSchema,\n  summary: 'List stored workspaces',\n  description: 'Returns a paginated list of all workspace configurations stored in the database',\n  tags: ['Stored Workspaces'],\n  requiresAuth: true,\n  handler: async ({ mastra, page, perPage, orderBy, 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 workspaceStore = await storage.getStore('workspaces');\n      if (!workspaceStore) {\n        throw new HTTPException(500, { message: 'Workspaces storage domain is not available' });\n      }\n\n      // Resolve the visibility scope for this caller. Non-owner queries for\n      // another author return nothing (workspaces have no `public` visibility\n      // yet); default lists return the caller's rows plus legacy unowned\n      // records.\n      const filter = resolveAuthorFilter({\n        requestContext,\n        resource: 'stored-workspaces',\n        queryAuthorId: authorId,\n      });\n\n      const scope = await getStoredResourceScope(mastra, requestContext);\n      const result = await workspaceStore.listResolved({\n        page,\n        perPage,\n        orderBy,\n        authorId: filter.kind === 'exact' ? filter.authorId : undefined,","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/stored-workspaces.ts#L34-L70","documentation":"Storage was configured, but storage.getStore('workspaces') returned null — the configured storage adapter does not provide the workspaces domain. The handler throws a 500 because it cannot proceed without a workspace store. Each storage adapter implements only the domains it supports.","triggerScenarios":"GET /api/stored/workspaces against a Mastra whose storage adapter lacks workspaces-domain support (older adapter version, or an adapter that implements only agents/threads/memory domains).","commonSituations":"Using an outdated @mastra/libsql/@mastra/pg version predating workspace stores; custom storage adapter without getStore('workspaces') support; adapter upgraded in app code but server package expects a newer one.","solutions":["Upgrade the storage adapter package to a version supporting the workspaces domain (pnpm update @mastra/libsql etc.)","Switch to a storage adapter known to support workspaces (e.g. current LibSQLStore or PgStore)","If using a custom adapter, implement the workspaces store domain in getStore","Verify adapter/server package versions are aligned in the workspace (pnpm why @mastra/core)"],"exampleFix":"// before (package.json)\n\"@mastra/libsql\": \"0.1.0\" // predates workspaces domain\n// after\n\"@mastra/libsql\": \"latest\" // then pnpm install and re-init schema\n","handlingStrategy":"fallback","validationCode":"import type { MastraStorage } from '@mastra/core';\nexport async function hasWorkspacesDomain(storage: MastraStorage): Promise<boolean> {\n  return Boolean(await storage.getStore('workspaces'));\n}","typeGuard":"function hasWorkspacesStore(s: unknown): s is { getStore: (d: 'workspaces') => Promise<unknown> } {\n  return !!s && typeof (s as any).getStore === 'function';\n}","tryCatchPattern":"try {\n  const res = await fetch(`${baseUrl}/api/stored/workspaces`);\n  if (!res.ok) throw Object.assign(new Error(await res.text()), { status: res.status });\n} catch (e: any) {\n  if (e.status === 500 && String(e.message).includes('Workspaces storage domain is not available')) {\n    console.warn('Adapter lacks workspaces support; falling back to runtime-only workspaces');\n  } else throw e;\n}","preventionTips":["Upgrade storage adapters to versions supporting the workspaces domain","Check adapter changelogs before upgrading @mastra/core","Run an integration test that calls getStore('workspaces') at boot","Pin adapter versions compatible with your server package"],"tags":["storage","adapter-compatibility","http-500","workspaces"],"backgroundTag":"storage-domain-not-supported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}