HeyPuter/puter · error · HttpError

cannot_write_to_root

cannot_write_to_root

Error message

Cannot write to root path

What it means

Error "Cannot write to root path" thrown in HeyPuter/puter.

Source

Thrown at src/backend/drivers/ai-video/VideoGenerationDriver.ts:485

        if (resolved === '~' || resolved.startsWith('~/')) {
            resolved = `/${username}${resolved.slice(1)}`;
        }
        assertNormalized(resolved);
        if (!resolved.startsWith('/')) {
            resolved = `/${resolved}`;
        }
        if (resolved.length > 1 && resolved.endsWith('/')) {
            resolved = resolved.slice(0, -1);
        }
        return resolved;
    }

    async #assertWriteAccess(
        actor: Actor,
        resolvedPath: string,
    ): Promise<void> {
        if (resolvedPath === '/') {
            throw new HttpError(400, 'Cannot write to root path', {
                legacyCode: 'cannot_write_to_root',
            });
        }
        const parentPath = pathPosix.dirname(resolvedPath);
        if (parentPath === '/') {
            throw new HttpError(400, 'Cannot write to root path', {
                legacyCode: 'cannot_write_to_root',
            });
        }

        const pathToCheck = parentPath;
        const fsService = this.services.fs;
        let ancestorsCache: Promise<
            Array<{ uid: string; path: string }>
        > | null = null;
        const canWrite = await this.services.acl.check(
            actor,
            {

View on GitHub (pinned to 908ec23eda)

Solutions

  1. Choose an output path inside a directory, not the filesystem root.
  2. Pass a valid puter_output_path such as ~/Videos/output.mp4.

When it happens

Trigger: Thrown at src/backend/drivers/ai-video/VideoGenerationDriver.ts:485 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HeyPuter/puter@908ec23eda (2026-08-12). Data as JSON: /api/errors/914de22fab7673fc. Report an issue: GitHub.