{"record":{"id":"43948b1f9d6144cc","repo":"mastra-ai/mastra","slug":"mount-requestedmount-not-found-available-mou","errorCode":null,"errorMessage":"Mount \"${requestedMount}\" not found. Available mounts: ${filesystem.mountPaths.join(', ')}","messagePattern":"Mount \"(.+?)\" not found\\. Available mounts: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"packages/server/src/server/handlers/workspace.ts","lineNumber":210,"sourceCode":"/**\n * Build the install path for a skill from skills.sh.\n *\n * For CompositeFilesystem: resolves the requested mount (or first writable),\n * validates it is writable, and returns `<mount>/.agents/skills/<skillId>`.\n * For non-composite: returns `.agents/skills/<skillId>` (unchanged behavior).\n */\n/** Strip a single trailing slash (leaves `/` alone). */\nfunction stripTrailingSlash(p: string): string {\n  return p.length > 1 && p.endsWith('/') ? p.slice(0, -1) : p;\n}\n\nfunction buildSkillInstallPath(filesystem: WorkspaceFilesystem, safeSkillId: string, requestedMount?: string): string {\n  if (isCompositeFilesystem(filesystem)) {\n    if (requestedMount) {\n      // Validate the requested mount exists\n      const mountFs = filesystem.mounts.get(requestedMount);\n      if (!mountFs) {\n        throw new HTTPException(400, {\n          message: `Mount \"${requestedMount}\" not found. Available mounts: ${filesystem.mountPaths.join(', ')}`,\n        });\n      }\n      if (mountFs.readOnly) {\n        throw new HTTPException(403, { message: `Mount \"${requestedMount}\" is read-only` });\n      }\n      return `${stripTrailingSlash(requestedMount)}/${SKILLS_SH_DIR}/${safeSkillId}`;\n    }\n\n    // Default: use first writable mount\n    for (const [mountPath, mountFs] of filesystem.mounts) {\n      if (!mountFs.readOnly) {\n        return `${stripTrailingSlash(mountPath)}/${SKILLS_SH_DIR}/${safeSkillId}`;\n      }\n    }\n\n    throw new HTTPException(403, { message: 'No writable mount available for skill installation' });\n  }","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/workspace.ts#L192-L228","documentation":"Thrown by buildSkillInstallPath when installing a skill from skills.sh into a composite workspace filesystem and the requested mount path does not exist in the CompositeFilesystem's mounts map. The server rejects the request with HTTP 400 and lists the mounts that actually exist so the caller can correct the path. It prevents silently installing a skill to a path derived from a nonexistent mount.","triggerScenarios":"Calling the skill install/skill path endpoints (installPath, skillPath handlers) with a mount query/body parameter that is not a registered mount key of the workspace's CompositeFilesystem — e.g. a typo'd mount name, a mount from a different workspace, or a mount removed after configuration changed.","commonSituations":"Hardcoded mount names in automation scripts, renamed workspace mounts without updating the client, using an absolute OS path instead of the mount path registered in CompositeFilesystem, or hitting a workspace whose mounts differ from the one documented.","solutions":["Read the 'Available mounts' list in the error message and retry with one of those exact mount paths.","Check the CompositeFilesystem configuration in your Mastra workspace setup to confirm the mount keys (filesystem.mountPaths).","If the mount was removed intentionally, drop the mount parameter and let the server pick the first writable mount.","If mounts are supplied dynamically, fix the client config/env that passes the wrong mount name."],"exampleFix":"// before\nawait installSkill({ workspaceId: 'w1', skillId: 'code-review', mount: '/workspace/data' });\n// after (mount that actually exists in CompositeFilesystem)\nawait installSkill({ workspaceId: 'w1', skillId: 'code-review', mount: '/workspace' });","handlingStrategy":"validation","validationCode":"const mounts = await getWorkspaceMountPaths(workspaceId); // e.g. from workspace filesystem.mountPaths\nif (mount && !mounts.includes(mount)) {\n  throw new Error(`Unknown mount \"${mount}\". Available: ${mounts.join(', ')}`);\n}","typeGuard":"function isValidMount(mount: string, mountPaths: readonly string[]): boolean {\n  return mountPaths.includes(mount);\n}","tryCatchPattern":"try {\n  await installSkill({ workspaceId, skillId, mount });\n} catch (e) {\n  if (isHttpException(e, 400) && /Mount .* not found/.test(e.message)) {\n    const available = e.message.match(/Available mounts: (.*)$/)?.[1]?.split(', ') ?? [];\n    return installSkill({ workspaceId, skillId, mount: available[0] });\n  }\n  throw e;\n}","preventionTips":["Fetch the workspace's mount list dynamically instead of hardcoding mount names.","Keep a single shared constant of mount paths between workspace config and clients.","Log available mounts on failure before retrying."],"tags":["workspace","filesystem","mount","bad-request","skill-install"],"backgroundTag":"mount-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}