{"record":{"id":"75839f1e6b6bb82a","repo":"mastra-ai/mastra","slug":"no-mount-for-source-src","errorCode":null,"errorMessage":"No mount for source: ${src}","messagePattern":"No mount for source: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/workspace/filesystem/composite-filesystem.ts","lineNumber":336,"sourceCode":"\n  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}`);","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workspace/filesystem/composite-filesystem.ts#L318-L354","documentation":"CompositeFilesystem routes every operation to a mounted filesystem by matching the path prefix against configured mount points (e.g. '/local', '/s3'). This error is thrown by copyFile when the SOURCE path does not resolve to any mount. The library throws it instead of guessing a backend, because it has no filesystem to read the source file from.","triggerScenarios":"Calling composite.copyFile(src, dest) where src has a prefix (or is not rooted under any) that matches no configured mount key; e.g. mounts are {'/data': ...} but you call copyFile('/other/a.txt', '/data/b.txt') or copyFile('a.txt', '/data/b.txt') without a default/root mount.","commonSituations":"Mount keys renamed or added after code was written (e.g. '/files' became '/data'); forgetting that the composite only exposes mount-prefixed paths; typos or missing leading slash; a mount removed during refactor; building paths by string concatenation that drops the mount prefix.","solutions":["Fix the source path so it starts with an existing mount path (check fs.mountPaths).","Register a mount for the missing prefix in the CompositeFilesystem config, or a root '/' mount as fallback.","Validate the source prefix with composite.getMountPathForPath(src) or getFilesystemForPath(src) before calling copyFile."],"exampleFix":"// before\nawait cfs.copyFile('report.pdf', '/local/report.pdf');\n// after\nawait cfs.copyFile('/local/report.pdf', '/local/report-copy.pdf');","handlingStrategy":"validation","validationCode":"if (!cfs.getMountPathForPath(src)) throw new Error(`Source path '${src}' 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 source:')) {\n    throw new Error(`Unknown workspace source '${src}'. Available mounts: ${cfs.mountPaths.join(', ')}`);\n  }\n  throw e;\n}","preventionTips":["Always build workspace paths from mount-path constants instead of string literals.","Call cfs.mountPaths at startup and assert the prefixes your app uses are configured.","Centralize path construction in one helper that prepends the correct mount prefix."],"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-30T03:17:51.788Z"}