{"record":{"id":"696a8cab691911dd","repo":"mastra-ai/mastra","slug":"no-mount-for-dest-dest","errorCode":null,"errorMessage":"No mount for dest: ${dest}","messagePattern":"No mount for dest: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/workspace/filesystem/composite-filesystem.ts","lineNumber":337,"sourceCode":"  async appendFile(path: string, content: FileContent): Promise<void> {\n    const r = this.resolveMount(path);\n    if (!r) throw new Error(`No mount for path: ${path}`);\n    this.assertWritable(r.fs, path, 'appendFile');\n    return r.fs.appendFile(r.fsPath, content);\n  }\n\n  async deleteFile(path: string, options?: RemoveOptions): Promise<void> {\n    const r = this.resolveMount(path);\n    if (!r) throw new Error(`No mount for path: ${path}`);\n    this.assertWritable(r.fs, path, 'deleteFile');\n    return r.fs.deleteFile(r.fsPath, options);\n  }\n\n  async copyFile(src: string, dest: string, options?: CopyOptions): Promise<void> {\n    const srcR = this.resolveMount(src);\n    const destR = this.resolveMount(dest);\n    if (!srcR) throw new Error(`No mount for source: ${src}`);\n    if (!destR) throw new Error(`No mount for dest: ${dest}`);\n    this.assertWritable(destR.fs, dest, 'copyFile');\n\n    // Same mount - delegate\n    if (srcR.mountPath === destR.mountPath) {\n      return srcR.fs.copyFile(srcR.fsPath, destR.fsPath, options);\n    }\n\n    // Cross-mount copy - read then write\n    const content = await srcR.fs.readFile(srcR.fsPath);\n    await destR.fs.writeFile(destR.fsPath, content, { overwrite: options?.overwrite });\n  }\n\n  async moveFile(src: string, dest: string, options?: CopyOptions): Promise<void> {\n    const srcR = this.resolveMount(src);\n    const destR = this.resolveMount(dest);\n    if (!srcR) throw new Error(`No mount for source: ${src}`);\n    if (!destR) throw new Error(`No mount for dest: ${dest}`);\n    this.assertWritable(destR.fs, dest, 'moveFile');","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workspace/filesystem/composite-filesystem.ts#L319-L355","documentation":"Thrown by CompositeFilesystem.copyFile when the DESTINATION path does not resolve to any configured mount. The composite needs a target backend to write into; without a matching mount prefix it refuses the operation rather than silently choosing one.","triggerScenarios":"composite.copyFile(src, dest) where dest's prefix matches no mount key, e.g. mounts {'/local': ...} and call copyFile('/local/a.txt', '/backup/a.txt') with no '/backup' mount.","commonSituations":"Adding a copy target to a new backend without mounting it; typo in the destination mount prefix; environment-specific mount configs (dest mount only exists in prod); moving files to a path meant for a default root mount that was never configured.","solutions":["Correct the destination path to start with an existing mount path from cfs.mountPaths.","Add the missing destination mount to the CompositeFilesystem config.","Pre-check with cfs.getMountPathForPath(dest) before copying and fail fast with a clearer app-level message."],"exampleFix":"// before\nawait cfs.copyFile('/local/a.txt', '/backup/a.txt'); // no '/backup' mount\n// after\nawait cfs.copyFile('/local/a.txt', '/local/backup/a.txt');","handlingStrategy":"validation","validationCode":"if (!cfs.getMountPathForPath(dest)) throw new Error(`Dest path '${dest}' does not match any mount: ${cfs.mountPaths.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await cfs.copyFile(src, dest);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('No mount for dest:')) {\n    throw new Error(`Unknown workspace destination '${dest}'. Available mounts: ${cfs.mountPaths.join(', ')}`);\n  }\n  throw e;\n}","preventionTips":["Keep the set of mount keys in a shared config and derive destination paths from it.","Add an integration test that exercises every copy/move route the app uses.","Fail fast at boot if any configured destination prefix has no mount."],"tags":["filesystem","mount-resolution","composite-filesystem"],"backgroundTag":"no-mount-for-path","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}