openclaw/openclaw · warning · ChromeMcpProcessSnapshotError

Unable to inspect the Chrome MCP process tree.

Error message

Unable to inspect the Chrome MCP process tree.

What it means

Thrown by listChromeMcpPlatformProcesses when the OS process-listing command (ps on Unix, powershell Get-CimInstance on Windows) fails or times out (2s budget). The generic message appears only when the caught value is not an Error instance; otherwise the original error message is preserved as the ChromeMcpProcessSnapshotError message with the original thrown as cause. This function backs best-effort subprocess-tree cleanup, so a failure here blocks tracking/killing the Chrome MCP process tree.

Source

Thrown at extensions/browser/src/browser/chrome-mcp-process.ts:117

            "-Command",
            'Get-CimInstance Win32_Process | ForEach-Object { "{0}`t{1}`t{2:o}`t{3}" -f $_.ProcessId,$_.ParentProcessId,$_.CreationDate,$_.ExecutablePath }',
          ]
        : ["-axww", "-o", "pid=,ppid=,lstart=,command="],
      {
        env: windows ? undefined : { ...process.env, LC_ALL: "C", TZ: "UTC" },
        logOutput: false,
        maxBuffer: 4 * 1024 * 1024,
        timeoutMs: 2_000,
      },
    );
    if (windows) {
      return parseChromeMcpDelimitedProcessList(stdout, platform);
    }
    // lstart is a fixed 24-byte C-locale field. Command shares the same row so
    // PID reuse within its one-second resolution cannot match another executable.
    return parseChromeMcpUnixProcessListForTest(stdout, platform);
  } catch (err) {
    throw new ChromeMcpProcessSnapshotError(
      err instanceof Error ? err.message : "Unable to inspect the Chrome MCP process tree.",
      { cause: err },
    );
  }
}

function captureChromeMcpProcessTarget(
  rootPid: number,
  snapshots: ChromeMcpProcessSnapshot[],
): ChromeMcpProcessCleanupTarget {
  const byPid = new Map(snapshots.map((snapshot) => [snapshot.pid, snapshot]));
  const root = byPid.get(rootPid);
  if (!root) {
    throw new ChromeMcpProcessSnapshotError(
      `Chrome MCP process identity unavailable for pid ${rootPid}.`,
    );
  }
  const childrenByParent = new Map<number, ChromeMcpProcessSnapshot[]>();

View on GitHub (pinned to 01804a7531)

Solutions

  1. Ensure the OS process-listing binary is installed and on PATH: install `procps` on Alpine (`apk add procps`) or confirm `ps` exists (`command -v ps`) on Unix; verify `powershell.exe` runs on Windows.
  2. If the host restricts process introspection, inject custom deps via getChromeMcpProcessCleanupDeps() (deps.listProcesses) so the lookup uses an allowed mechanism.
  3. Raise exec throughput or reduce process-table size (close runaway processes) so enumeration completes within the 2_000ms timeout.
  4. Inspect err.cause on the thrown ChromeMcpProcessSnapshotError to see the real underlying spawn/exec error and address that specifically.

Example fix

// before: relies on `ps` being present and fast
// (default deps path)
await refreshChromeMcpCleanupProcess(session);

// after: provide a custom process-listing dep for locked-down hosts
setChromeMcpProcessCleanupDeps({
  listProcesses: async () => readChromeMcpProcessTreeViaProcFs(rootPid),
});
Defensive patterns

Strategy: try-catch

Validate before calling

// Confirm the platform process-lister is available before relying on cleanup
import { existsSync } from "node:fs";
const psPresent = process.platform !== "win32"
  ? existsSync("/bin/ps") || existsSync("/usr/bin/ps")
  : true; // assume powershell on win32
if (!psPresent) {
  // install procps or inject deps.listProcesses before launching Chrome MCP
}

Type guard

import { ChromeMcpProcessSnapshotError } from "./chrome-mcp-contracts.js";

function isProcessSnapshotError(err: unknown): err is ChromeMcpProcessSnapshotError {
  return err instanceof ChromeMcpProcessSnapshotError;
}

Try / catch

try {
  await refreshChromeMcpCleanupProcess(session);
} catch (err) {
  if (err instanceof ChromeMcpProcessSnapshotError) {
    // best-effort: log err.cause and continue; process tree tracking is unavailable
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling any Chrome MCP operation that triggers refreshChromeMcpCleanupProcess or terminateChromeMcpProcessTree on a host where `ps` (Unix) or `powershell.exe` (Windows) is absent, not on PATH, permission-denied, or slower than the 2_000ms exec timeout. Also triggered if a custom deps.listProcesses override rejects, or if a non-Error value (e.g. a string or plain object) is thrown by the platform listing.

Common situations: Minimal containers (Alpine/distroless) without procps `ps` installed; Windows hosts with PowerShell execution policy restrictions or missing CIM provider; sandboxed environments where invoking `ps`/`powershell` is blocked; slow or overloaded machines where enumerating all processes exceeds 2s; CI runners with restricted process introspection.

Related errors


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