openclaw/openclaw · error · Error
${label} must be a valid file URI: ${error instanceof Error
Error message
${label} must be a valid file URI: ${error instanceof Error ? error.message : String(error)} What it means
Error "${label} must be a valid file URI: ${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:12
/** Converts Codex PathUri protocol values into sandbox-backend path strings. */
import { fileURLToPath } from "node:url";
const WINDOWS_DRIVE_PATH_RE = /^\/[A-Za-z]:(?:\/|$)/u;
/** Resolves one Codex exec-server PathUri into a POSIX sandbox path. */
export function resolveExecServerPath(rawPath: string, label: string): string {
let pathUrl: URL;
try {
pathUrl = new URL(rawPath);
} catch (error) {
throw new Error(
`${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) {View on GitHub (pinned to 01804a7531)
When it happens
Trigger: Thrown at extensions/codex/src/app-server/sandbox-exec-server/path-uri.ts:12 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/2cb729e510c315ad.
Report an issue: GitHub.