openclaw/openclaw · error · Error

${label} file URI is not valid for the sandbox: ${error inst

Error message

${label} file URI is not valid for the sandbox: ${error instanceof Error ? error.message : String(error)}

What it means

Error "${label} file URI is not valid for the sandbox: ${error instanceof Error ? error.message : String(error)}" thrown in openclaw/openclaw.

Source

Thrown at extensions/codex/src/app-server/sandbox-exec-server/path-uri.ts:31

      `${label} must be a valid file URI: ${error instanceof Error ? error.message : String(error)}`,
      { cause: error },
    );
  }
  if (pathUrl.protocol !== "file:") {
    throw new Error(
      `${label} URI must use the file scheme, received ${pathUrl.protocol.slice(0, -1)}.`,
    );
  }
  if (pathUrl.search || pathUrl.hash) {
    throw new Error(`${label} file URI must not include a query or fragment.`);
  }
  let resolved: string;
  try {
    // The URI names the sandbox target, so decode with POSIX rules even when
    // the Gateway host is Windows. Docker and SSH backends own POSIX workdirs.
    resolved = fileURLToPath(pathUrl, { windows: false });
  } catch (error) {
    throw new Error(
      `${label} file URI is not valid for the sandbox: ${error instanceof Error ? error.message : String(error)}`,
      { cause: error },
    );
  }
  if (WINDOWS_DRIVE_PATH_RE.test(resolved)) {
    // OpenClaw exec-server backends currently expose Docker/SSH POSIX paths.
    // Reject foreign drive URIs instead of silently rewriting their meaning.
    throw new Error(`${label} Windows file URI is not supported by the sandbox.`);
  }
  if (resolved.includes("\0")) {
    throw new Error(`${label} file URI must not contain a null byte.`);
  }
  return resolved;
}

View on GitHub (pinned to 01804a7531)

When it happens

Trigger: Thrown at extensions/codex/src/app-server/sandbox-exec-server/path-uri.ts:31 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/acc15619e1a9f3c6. Report an issue: GitHub.