{"record":{"id":"864f3b71cc521445","repo":"mastra-ai/mastra","slug":"no-mount-for-path-path","errorCode":null,"errorMessage":"No mount for path: ${path}","messagePattern":"No mount for path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/workspace/filesystem/composite-filesystem.ts","lineNumber":308,"sourceCode":"    this.status = 'destroying';\n    const errors: Error[] = [];\n    for (const fs of this._mounts.values()) {\n      try {\n        await callLifecycle(fs, 'destroy');\n      } catch (e) {\n        errors.push(e instanceof Error ? e : new Error(String(e)));\n      }\n    }\n    if (errors.length > 0) {\n      this.status = 'error';\n      throw new AggregateError(errors, 'Some filesystems failed to destroy');\n    }\n    this.status = 'destroyed';\n  }\n\n  async readFile(path: string, options?: ReadOptions): Promise<string | Buffer> {\n    const r = this.resolveMount(path);\n    if (!r) throw new Error(`No mount for path: ${path}`);\n    return r.fs.readFile(r.fsPath, options);\n  }\n\n  async writeFile(path: string, content: FileContent, options?: WriteOptions): 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, 'writeFile');\n    return r.fs.writeFile(r.fsPath, content, options);\n  }\n\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> {","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workspace/filesystem/composite-filesystem.ts#L290-L326","documentation":"readFile on CompositeFilesystem resolves the path against registered mount prefixes; when no mount matches, it cannot delegate the read and throws this error. The composite does not have a fallback/root mount, so any path outside all mount prefixes is unresolvable.","triggerScenarios":"await composite.readFile(path) where path's prefix doesn't match any key in mounts (e.g., reading '/etc/x' when only '/data' is mounted), or calling readFile after destroy() (mounts cleared) — also via content().","commonSituations":"Assuming the composite behaves like a root filesystem ('/') when only subdirectories are mounted; path normalization mismatches (missing leading slash, 'C:\\\\' vs '/'); reading a path after destroy().","solutions":["Use a path under one of the mounted prefixes; log Object.keys(mounts) to see valid roots.","Mount an additional prefix covering the path you need to read (or mount '/' as catch-all).","Normalize the path before calling (ensure leading '/', forward slashes, resolved relative segments).","If destroy() was called, re-create the composite before further reads."],"exampleFix":"// before\nawait fs.readFile('/tmp/report.txt'); // only '/data' mounted\n// after\nawait fs.readFile('/data/reports/report.txt');","handlingStrategy":"validation","validationCode":"function resolveMounted(path: string, mounts: Record<string, unknown>): boolean {\n  const p = path.startsWith('/') ? path : '/' + path;\n  return Object.keys(mounts).some(prefix => p === prefix || p.startsWith(prefix + '/'));\n}\nif (!resolveMounted(path, mounts)) throw new Error(`Path ${path} is not covered by any mount`);","typeGuard":null,"tryCatchPattern":"try { return await composite.readFile(path); } catch (e) { if ((e as Error).message.startsWith('No mount for path')) { return readThroughFallback(path); } throw e; }","preventionTips":["Normalize all paths (leading '/', forward slashes) before calls.","Keep a '/' catch-all mount if arbitrary paths must work.","Never call the composite after destroy()."],"tags":["workspace","filesystem","path-resolution","mount"],"backgroundTag":"path-not-mounted","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}