{"record":{"id":"ddd61912c82a4673","repo":"abhigyanpatwari/GitNexus","slug":"required-executable-is-unavailable-default","errorCode":null,"errorMessage":"required executable is unavailable: {default}","messagePattern":"required executable is unavailable: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/proposer_sandbox.py","lineNumber":467,"sourceCode":"    /usr/bin/python3 is a real system binary, but it's root-owned on the host.\n    Inside this --unshare-user sandbox only the calling uid is mapped (root is\n    not), so root-owned files surface as the kernel's overflow uid — which\n    evidence-provenance.mjs's PATH-scan correctly refuses to trust. This\n    wrapper is freshly created by the same host process that owns\n    home/temp/shell-prefix, so it maps to the sandbox's own trusted uid\n    instead, and simply execs the real interpreter through to do the work.\n    \"\"\"\n\n    wrapper = private_root / \"python3\"\n    wrapper.write_text('#!/bin/bash\\nset -eu\\nexec /usr/bin/python3 \"$@\"\\n')\n    wrapper.chmod(0o500)\n    return wrapper\n\n\ndef _resolve_executable(executable: Path | str | None, default: str) -> Path:\n    raw = os.fspath(executable) if executable is not None else shutil.which(default)\n    if not raw:\n        raise SandboxError(f\"required executable is unavailable: {default}\")\n    path = Path(raw).expanduser().resolve()\n    if not path.is_file() or not os.access(path, os.X_OK):\n        raise SandboxError(f\"required executable is not an executable regular file: {path}\")\n    return path\n\n\ndef preflight_bubblewrap(bwrap_bin: Path | str | None = None) -> Path:\n    \"\"\"Prove the required namespaces work; never fall back to host execution.\"\"\"\n\n    if sys.platform != \"linux\":\n        raise SandboxError(f\"Bubblewrap containment is supported only on Linux/WSL2, not {sys.platform}\")\n    bwrap = _resolve_executable(bwrap_bin, \"bwrap\")\n    command = [\n        str(bwrap),\n        \"--unshare-user\",\n        \"--unshare-pid\",\n        \"--unshare-ipc\",\n        \"--unshare-uts\",","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/proposer_sandbox.py#L449-L485","documentation":"Raised by _resolve_executable when no executable was supplied and shutil.which(default) returned None — i.e. the required tool is not on PATH. The sandbox resolves tools like bwrap, socat, python3, node by name and refuses to proceed if the binary cannot be located, since containment correctness depends on the real binary being present.","triggerScenarios":"_resolve_executable(None, 'bwrap') (or 'socat', 'node', etc.) where the named binary is absent from every directory in PATH. Also when an explicit executable value resolves to an empty string.","commonSituations":"bubblewrap not installed on the host (apt/dnf package missing); socat not installed (needed by the inner sandbox preflight); PATH is minimal inside CI/containers and omits /usr/bin or /usr/local/bin; running on a machine where the tool is aliased but not actually installed; a venv/uv activation rewrote PATH and dropped a directory.","solutions":["Install the missing tool: 'sudo apt-get install -y bubblewrap socat' (or distro equivalent).","Verify with 'which bwrap socat' from the same shell/env the driver uses.","If the tool lives at a known absolute path, pass it explicitly: preflight_bubblewrap('/usr/local/bin/bwrap').","Fix PATH in the runner's environment so the directory containing the tool is present."],"exampleFix":"// before\nbwrap = preflight_bubblewrap()  # bwrap not on PATH\n// after\n# install first, then:\nbwrap = preflight_bubblewrap('/usr/bin/bwrap')","handlingStrategy":"validation","validationCode":"import shutil\n\ndef available(default: str) -> bool:\n    return shutil.which(default) is not None\n\nmissing = [d for d in ('bwrap','socat','node','python3') if not available(d)]\nif missing:\n    raise EnvironmentError(f'install required tools: {missing}')","typeGuard":"import shutil\n\ndef is_resolvable_executable(default: str) -> bool:\n    return shutil.which(default) is not None","tryCatchPattern":"try:\n    bwrap = preflight_bubblewrap()\nexcept SandboxError as exc:\n    if 'unavailable' in str(exc):\n        raise SystemExit(f'install bwrap: {exc}')\n    raise","preventionTips":["Document required system tools in setup.","Verify tools with `which` in a preflight step.","Pin tool availability in CI image.","Pass explicit absolute paths when PATH is unreliable."],"tags":["environment","executable","dependency","sandbox"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}