{"record":{"id":"2bbc8e226123eb52","repo":"mastra-ai/mastra","slug":"registry-not-found","errorCode":null,"errorMessage":"Registry not found","messagePattern":"Registry not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"packages/server/src/server/handlers/builder-registry.ts","lineNumber":90,"sourceCode":"  const registries = builder?.getRegistries?.();\n  return [\n    {\n      id: 'skills-sh',\n      enabled: registries?.skillsSh?.enabled === true,\n      label: REGISTRY_LABELS['skills-sh']!,\n    },\n  ];\n}\n\n/**\n * Hard-gate: throws 404 when the requested registry is unknown or disabled.\n * Mirrors `requireBuilderFeature` semantics — no surface leak for OFF registries.\n */\nasync function requireEnabledRegistry(mastra: Mastra, registryId: string): Promise<void> {\n  const list = await resolveRegistries(mastra);\n  const match = list.find(r => r.id === registryId);\n  if (!match || !match.enabled) {\n    throw new HTTPException(404, { message: 'Registry not found' });\n  }\n}\n\n// =============================================================================\n// File-tree helpers\n// =============================================================================\n\n/**\n * Convert a flat list of `{ path, content, encoding }` entries into the\n * `StorageSkillFileNode` tree shape expected by the stored-skills create path.\n *\n * Each path is validated via `assertSafeFilePath` to prevent traversal from\n * upstream-controlled responses. Folder nodes are created on demand.\n */\nfunction buildFileTree(\n  files: Array<{ path: string; content: string; encoding: 'utf-8' | 'base64' }>,\n): StorageSkillFileNode[] {\n  const root: StorageSkillFileNode[] = [];","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/builder-registry.ts#L72-L108","documentation":"requireEnabledRegistry resolves the configured builder registries on the Mastra instance and throws a 404 HTTPException when the requested registryId is absent from the list or present but disabled. It deliberately returns 404 (not 403) so that OFF registries are indistinguishable from nonexistent ones — no configuration surface leaks. It guards the search, popular, preview, and install builder-registry routes.","triggerScenarios":"Any BUILDER_REGISTRY route (search, popular, preview, install) called with a registryId that is not in the resolved registry list, or whose entry has enabled=false.","commonSituations":"Typo or stale registry ID in client code; registry was disabled via configuration/environment after a client cached its ID; multi-tenant setup where the registry exists on another instance; registries not configured at all on this server.","solutions":["Confirm the registryId matches an ID in the server's configured registry list (resolveRegistries output).","Enable the registry in the server configuration if it exists but is disabled.","Call the registry-list endpoint (or inspect server config) to discover valid registry IDs before calling search/preview/install.","If the registry should exist, verify you are hitting the correct Mastra server/deployment where it is configured."],"exampleFix":"// before\nawait fetch('/api/builder/registry/my-registry/search?q=skills');\n\n// after\nconst registries = await fetch('/api/builder/registries').then(r => r.json());\nconst reg = registries.find(r => r.id === 'my-registry' && r.enabled);\nif (!reg) throw new Error('Registry not configured or disabled on this server');","handlingStrategy":"validation","validationCode":"const registries = await listRegistries();\nconst reg = registries.find(r => r.id === registryId);\nif (!reg || !reg.enabled) throw new Error(`Registry \"${registryId}\" is not available on this server`);","typeGuard":"function isRegistryAvailable(r: { id: string; enabled: boolean } | undefined): r is { id: string; enabled: true } {\n  return !!r && r.enabled === true;\n}","tryCatchPattern":null,"preventionTips":["Fetch and cache the registry list at startup; validate IDs against it before any registry call.","Centralize registry IDs as constants derived from the server's config, never hardcode strings.","Re-validate cached registry IDs after server config changes or redeployments.","Treat 404 on registry routes as 'disabled or unknown' — the API intentionally does not distinguish them."],"tags":["http-404","builder-registry","feature-flag"],"backgroundTag":"resource-not-found-404","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}