{"record":{"id":"456c649406dc5e0a","repo":"mastra-ai/mastra","slug":"storage-is-not-configured-456c64","errorCode":null,"errorMessage":"Storage is not configured","messagePattern":"Storage is not configured","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"critical","filePath":"packages/server/src/server/handlers/stored-skills.ts","lineNumber":138,"sourceCode":"  requiresAuth: true,\n  handler: async ({\n    mastra,\n    requestContext,\n    page,\n    perPage,\n    orderBy,\n    status,\n    authorId,\n    visibility,\n    metadata,\n    favoritedOnly,\n    pinFavoritedFor,\n  }) => {\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 skillStore = await storage.getStore('skills');\n      if (!skillStore) {\n        throw new HTTPException(500, { message: 'Skills storage domain is not available' });\n      }\n\n      const filter = resolveAuthorFilter({\n        requestContext,\n        resource: 'stored-skills',\n        queryAuthorId: authorId,\n        queryVisibility: visibility,\n      });\n\n      const scope = await getStoredResourceScope(mastra, requestContext);\n      const scopedMetadata = scopeStoredResourceMetadata(metadata, scope);\n\n      const callerId = getCallerAuthorId(requestContext);","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/stored-skills.ts#L120-L156","documentation":"The stored-skills list handler calls mastra.getStorage() and throws HTTPException 500 'Storage is not configured' when it returns undefined/null. Mastra requires a storage instance for stored skills; without one the server cannot serve the route at all. Unlike the domain-level errors, here no storage object exists whatsoever.","triggerScenarios":"GET (list) /stored/skills (the handler at stored-skills.ts:138) against a Mastra instance constructed without a storage option, or where getStorage() yields undefined due to config resolution failure.","commonSituations":"Omitting the storage option in new Mastra({...}); storage package not installed or failing to import; environment variable for the storage URL missing so the adapter constructor is skipped; minimal/test server deployments without persistence.","solutions":["Add a storage adapter to the Mastra constructor: new Mastra({ storage: new LibSQLStore({ url: process.env.DATABASE_URL }) })","Ensure the storage package (@mastra/libsql, @mastra/pg, etc.) is installed and version-compatible","Check server startup logs for storage initialization errors and fix the missing env vars (DATABASE_URL etc.)","If intentionally running without persistence, don't expose/enable the builder stored-skills routes"],"exampleFix":"// before\nnew Mastra({ agents }); // no storage\n\n// after\nnew Mastra({ agents, storage: new LibSQLStore({ url: process.env.DATABASE_URL! }) });","handlingStrategy":"fallback","validationCode":"import { mastra } from './mastra';\nif (!mastra.getStorage()) {\n  throw new Error('Boot aborted: Mastra storage is not configured');\n}","typeGuard":"function hasStorage(m: { getStorage(): unknown }): boolean {\n  return m.getStorage() != null;\n}","tryCatchPattern":"try {\n  return await api.get('/stored/skills');\n} catch (e) {\n  if (isHttpError(e) && e.status === 500 && e.message === 'Storage is not configured') {\n    showStorageSetupGuide(); return emptyPage;\n  }\n  throw e;\n}","preventionTips":["Always pass storage in new Mastra({...}) for any deployment serving stored resources","Fail fast at startup when getStorage() is undefined","Keep DATABASE_URL and similar env vars in deployment config checks"],"tags":["storage","configuration","server","stored-skills"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}