{"record":{"id":"914de22fab7673fc","repo":"HeyPuter/puter","slug":"cannot-write-to-root-914de2","errorCode":"cannot_write_to_root","errorMessage":"Cannot write to root path","messagePattern":"Cannot write to root path","errorType":"http","errorClass":"HttpError","httpStatus":400,"severity":"error","filePath":"src/backend/drivers/ai-video/VideoGenerationDriver.ts","lineNumber":485,"sourceCode":"        if (resolved === '~' || resolved.startsWith('~/')) {\n            resolved = `/${username}${resolved.slice(1)}`;\n        }\n        assertNormalized(resolved);\n        if (!resolved.startsWith('/')) {\n            resolved = `/${resolved}`;\n        }\n        if (resolved.length > 1 && resolved.endsWith('/')) {\n            resolved = resolved.slice(0, -1);\n        }\n        return resolved;\n    }\n\n    async #assertWriteAccess(\n        actor: Actor,\n        resolvedPath: string,\n    ): Promise<void> {\n        if (resolvedPath === '/') {\n            throw new HttpError(400, 'Cannot write to root path', {\n                legacyCode: 'cannot_write_to_root',\n            });\n        }\n        const parentPath = pathPosix.dirname(resolvedPath);\n        if (parentPath === '/') {\n            throw new HttpError(400, 'Cannot write to root path', {\n                legacyCode: 'cannot_write_to_root',\n            });\n        }\n\n        const pathToCheck = parentPath;\n        const fsService = this.services.fs;\n        let ancestorsCache: Promise<\n            Array<{ uid: string; path: string }>\n        > | null = null;\n        const canWrite = await this.services.acl.check(\n            actor,\n            {","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/HeyPuter/puter/blob/908ec23eda38526170322c3edf71ba45ecb1ca95/src/backend/drivers/ai-video/VideoGenerationDriver.ts#L467-L503","documentation":"Error \"Cannot write to root path\" thrown in HeyPuter/puter.","triggerScenarios":"Thrown at src/backend/drivers/ai-video/VideoGenerationDriver.ts:485 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose an output path inside a directory, not the filesystem root.","Pass a valid puter_output_path such as ~/Videos/output.mp4."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"908ec23eda38526170322c3edf71ba45ecb1ca95","analyzedAt":"2026-08-12T20:53:15.911Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}