{"record":{"id":"1c305c448fb03b36","repo":"mastra-ai/mastra","slug":"storage-is-not-configured-1c305c","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/builder-registry.ts","lineNumber":336,"sourceCode":"export const BUILDER_REGISTRY_INSTALL_ROUTE = createRoute({\n  method: 'POST',\n  path: '/editor/builder/registries/:registryId/install',\n  responseType: 'json',\n  pathParamSchema: builderRegistryPathParams,\n  bodySchema: builderRegistryInstallBodySchema,\n  responseSchema: builderRegistryInstallResponseSchema,\n  summary: 'Install a registry skill into stored skills',\n  description: 'Fetches a skill from the configured registry and persists it as a new stored skill.',\n  tags: ['Editor', 'Skills'],\n  requiresAuth: true,\n  requiresPermission: 'stored-skills:write',\n  handler: async ({ mastra, requestContext, registryId, owner, repo, skillName, visibility: bodyVisibility }) => {\n    try {\n      await requireEnabledRegistry(mastra, registryId);\n\n      const storage = mastra.getStorage();\n      if (!storage) {\n        throw new HTTPException(500, { message: 'Storage is not configured' });\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      // Pull files from the registry\n      const result = await fetchSkillFiles(owner, repo, skillName);\n      if (!result || result.files.length === 0) {\n        throw new HTTPException(404, {\n          message: `Could not find skill \"${skillName}\" in ${owner}/${repo}.`,\n        });\n      }\n\n      const safeSkillId = assertSafeSkillName(result.skillId);\n      const files = buildFileTree(result.files);\n\n      // Parse SKILL.md frontmatter into structured fields. Splitting","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/builder-registry.ts#L318-L354","documentation":"The builder-registry install-skill handler requires persistent storage to save the imported skill. It throws a 500 HTTPException when mastra.getStorage() returns null/undefined, meaning no storage was configured on the Mastra instance. Without storage, imported registry skills cannot be persisted, so the operation fails fast.","triggerScenarios":"POSTing to the builder-registry install route (with a valid, enabled registryId, owner, repo, skillName) on a Mastra instance that was constructed without a storage configuration.","commonSituations":"Local/dev Mastra instances with no storage configured; storage removed during a config refactor; in-memory instance deployed where persistence is now required for builder features; wrong Mastra instance (one without storage) serving the playground.","solutions":["Configure storage on the Mastra instance (e.g. new Mastra({ storage: new MastraLibsqlStorage({...}) }) or your preferred adapter) and restart the server.","Verify with a quick runtime check that mastra.getStorage() returns an object in your deployment.","If storage is intentionally absent, do not use the builder-registry install route; import skills directly into whatever persistence you use.","Confirm the storage package is installed and its constructor does not silently fail."],"exampleFix":"// before\nnew Mastra({ agents, logger });\n\n// after\nimport { MastraStorageLibSQL } from '@mastra/storage-libsql';\nnew Mastra({ agents, logger, storage: new MastraStorageLibSQL({ url: process.env.DATABASE_URL }) });","handlingStrategy":"validation","validationCode":"// server-side guard before enabling builder-registry routes\nif (!mastra.getStorage()) {\n  throw new Error('builder-registry install requires storage; configure Mastra storage');\n}","typeGuard":"function hasStorage(m: { getStorage(): unknown }): boolean {\n  return m.getStorage() != null;\n}","tryCatchPattern":"try {\n  await installSkill(payload);\n} catch (e) {\n  if (e.status === 500 && e.message === 'Storage is not configured') {\n    // surface a config error to the operator, not the end user\n  } else throw e;\n}","preventionTips":["Always configure storage in production Mastra instances.","Add a startup assertion that getStorage() returns a value when builder features are enabled.","Keep storage configuration in shared config so dev/prod parity holds.","Document that builder-registry install is a persistence-requiring feature."],"tags":["http-500","storage","configuration"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}