Skip to content

docs: troubleshooting for bwrap sandbox failures on restricted hosts#1

Open
AZERIA-IT wants to merge 1 commit into
mainfrom
docs/troubleshooting-bwrap-sandbox
Open

docs: troubleshooting for bwrap sandbox failures on restricted hosts#1
AZERIA-IT wants to merge 1 commit into
mainfrom
docs/troubleshooting-bwrap-sandbox

Conversation

@AZERIA-IT
Copy link
Copy Markdown
Owner

Summary

  • Document the bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted failure mode that surfaces on VPS / LXC / capability-restricted hosts when Codex tries to write files inside a codex-task turn.
  • Clarify that this is a host-level sandboxer issue, not a claude-code-codex-task bug — the wrapper's launch / poll / result lifecycle still completes correctly; only the Codex worker's apply_patch and shell exec fail.
  • Provide two pragmatic workarounds:
    • host-side: sysctl kernel.unprivileged_userns_clone=1 (where the provider allows it),
    • codex-side: approval_policy = "never" + sandbox_mode = "danger-full-access" in ~/.codex/config.toml, with the explicit caveat that this should only be used on hosts that are themselves sandboxes.
  • Surface a relevant upstream detail: codex-companion.mjs currently hard-codes the per-turn sandbox to workspace-write regardless of the user's config.toml (line ~488 in v1.0.4), so on broken-bwrap hosts users may also need to patch the companion script or call codex exec --dangerously-bypass-approvals-and-sandbox directly.

Motivation

Hit this on an OVH VPS today during a clean install of the subagent. The wrapper itself behaved correctly (4m35s alive, returned terminal completion), but every Codex worker turn failed silently from the user's POV with a write-permission summary, which is easy to misattribute to this repo.

Test plan

  • Reproduced the failure on an OVH VPS (bwrap loopback denied), codex exec and the codex-task wrapper both affected
  • Confirmed both proposed workarounds resolve the symptom on the same host:
    • codex exec --dangerously-bypass-approvals-and-sandbox → file written, terminal status completed
    • Patched codex-companion.mjs to pass danger-full-access → wrapper round-trip succeeded in 43s (was failing at 4m35s before)
  • README renders correctly on github.com once the PR is merged

Out of scope

  • No code or installer changes — docs-only patch.
  • Not opening the upstream PR against openai/codex-plugin-cc here; that's a separate ask.

Document the bwrap loopback failure mode that surfaces on VPS / LXC / capability-restricted hosts (apply_patch + shell sandbox refuse to write).

Covers root cause (Codex sandboxer cannot init network namespace), two workarounds (host-side sysctl unprivileged_userns_clone, codex-side bypass via config.toml), and notes that codex-companion.mjs hard-codes the per-turn sandbox to workspace-write — relevant when relying on a config.toml-level danger-full-access override.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant