abhigyanpatwari/GitNexus · error · SandboxError

Bubblewrap containment is supported only on Linux/WSL2, not

Error message

Bubblewrap containment is supported only on Linux/WSL2, not {sys.platform}

What it means

Raised by preflight_bubblewrap when sys.platform is not 'linux'. Bubblewrap (bwrap) uses Linux user/mount/pid namespaces that exist only on Linux (and WSL2, which reports as linux), so on macOS, Windows-native, or other platforms the preflight refuses to continue rather than fall back to host execution.

Source

Thrown at eval/workflow_bench/proposer_sandbox.py:478

    wrapper.chmod(0o500)
    return wrapper


def _resolve_executable(executable: Path | str | None, default: str) -> Path:
    raw = os.fspath(executable) if executable is not None else shutil.which(default)
    if not raw:
        raise SandboxError(f"required executable is unavailable: {default}")
    path = Path(raw).expanduser().resolve()
    if not path.is_file() or not os.access(path, os.X_OK):
        raise SandboxError(f"required executable is not an executable regular file: {path}")
    return path


def preflight_bubblewrap(bwrap_bin: Path | str | None = None) -> Path:
    """Prove the required namespaces work; never fall back to host execution."""

    if sys.platform != "linux":
        raise SandboxError(f"Bubblewrap containment is supported only on Linux/WSL2, not {sys.platform}")
    bwrap = _resolve_executable(bwrap_bin, "bwrap")
    command = [
        str(bwrap),
        "--unshare-user",
        "--unshare-pid",
        "--unshare-ipc",
        "--unshare-uts",
        "--die-with-parent",
        "--new-session",
        *_runtime_mount_args(),
        "--proc",
        "/proc",
        "--dev",
        "/dev",
        "--",
        "/usr/bin/true",
    ]
    result = run_managed(command, timeout=10, require_pid_namespace=True)

View on GitHub (pinned to d540b00184)

Solutions

  1. Run the workflow_bench/proposer pipeline on a Linux host or Linux container (the supported environment).
  2. On Windows, use WSL2 (which reports sys.platform as 'linux') and run from inside it.
  3. Gate the call behind a platform check in your own code so non-Linux dev workloads skip containment.
  4. For local dev that does not need real containment, exercise a non-bwrap code path if one exists, or move to Linux.

Example fix

// before
bwrap = preflight_bubblewrap()  # on macOS
// after
if sys.platform != 'linux':
    raise SystemExit('run this benchmark under Linux or WSL2')
bwrap = preflight_bubblewrap()
Defensive patterns

Strategy: validation

Validate before calling

import sys

def assert_linux():
    if sys.platform != 'linux':
        raise SystemExit(f'workflow_bench requires Linux/WSL2, not {sys.platform}')

assert_linux()

Type guard

import sys

def supports_bubblewrap() -> bool:
    return sys.platform == 'linux'

Try / catch

try:
    bwrap = preflight_bubblewrap()
except SandboxError as exc:
    if 'supported only on Linux' in str(exc):
        raise SystemExit('switch to a Linux host or WSL2 to run this benchmark')
    raise

Prevention

When it happens

Trigger: Importing and calling preflight_bubblewrap (or any code path that reaches it) on a platform where sys.platform != 'linux' — e.g. darwin (macOS), win32, cygwin, aix, freebsd.

Common situations: Developer runs the eval harness on a macOS workstation instead of the Linux CI; a cross-platform test suite imports the sandbox module on Windows; a CI matrix accidentally includes a macos-latest job that hits this code path; a container reports a non-linux platform due to a broken image.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/8b54f85e3295aa77. Report an issue: GitHub.