Sandboxed tool calls fail on Ubuntu 20.04 with bubblewrap 0.4.0 ('bwrap: Unknown option --argv0')
What version of Codex is running?
codex-cli 0.116.0
What subscription do you have?
Pro
Which model were you using?
Observed in the Codex CLI agent environment. The failure appears to happen before model-specific behavior matters.
What platform is your computer?
Ubuntu 20.04.6 LTS (focal), amd64
What issue are you seeing?
Description
On Ubuntu 20.04.6 with the system bubblewrap package (0.4.0-1ubuntu4.1), sandboxed tool calls fail immediately with:
bwrap: Unknown option --argv0
In the same environment, commands that bypass the normal sandbox path can still run, which suggests this is specifically a sandbox wrapper compatibility problem.
Reproduction
- Use Ubuntu 20.04.6 LTS with
/usr/bin/bwrapprovided by the distro packagebubblewrap 0.4.0-1ubuntu4.1 - Run Codex CLI (
codex-cli 0.116.0) - Trigger a normal sandboxed tool call
- Observe immediate failure with
bwrap: Unknown option --argv0
Expected behavior
Codex should either:
- gracefully support older
bubblewrapversions, - detect that the installed
bwrapdoes not support--argv0and show a clearer compatibility error, - or provide a documented fallback path before attempting sandbox launch.
Additional evidence
bwrap --versionreportsbubblewrap 0.4.0bwrap --helpdoes not list--argv0/usr/bin/bwrapis owned by the Ubuntu packagebubblewrapapt-cache policy bubblewrapon this machine shows:
Installed: 0.4.0-1ubuntu4.1
Candidate: 0.4.0-1ubuntu4.1
500 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 Packages
500 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 Packages
This means a normal apt upgrade on Ubuntu 20.04 will not reach a version that supports --argv0.
Likely root cause
Codex appears to assume bubblewrap supports --argv0, but Ubuntu 20.04 ships an older version that does not. This seems like a Codex / local sandbox compatibility gap rather than a repo-specific problem.
Possibly related official issues
- #848
- #973
- #1039
14 Comments
Additional diagnostic details from the affected machine:
A few practical observations:
That makes this look less like a repo-specific failure and more like a compatibility assumption in the sandbox wrapper: Codex appears to invoke
bwrapwith--argv0, but Ubuntu 20.04's packagedbubblewrapdoes not support that flag.If helpful, I can also test a patched/local newer
bubblewrapon the same machine and report whether that fully resolves the issue.Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This also reproduces for me on Rocky Linux 8.10 via the VS Code extension’s bundled Codex (
openai.chatgpt-26.318.11754-linux-x64, bundledcodex-cli 0.116.0-alpha.10).On this system,
/usr/bin/bwrap --versionisbubblewrap 0.4.0and/usr/local/bin/bwrap --versionisbubblewrap 0.9.0.The error is the same:
bwrap: Unknown option --argv0.Downgrading the extension by one version avoids the issue. Restarting VS Code Server, changing
PATH, and settingBWRAP/BUBBLEWRAPdid not help.Additional confirmed repro on Ubuntu 22.04 (Jammy):
codex-cli 0.116.0/usr/bin/bwrapfrom Ubuntu packagebubblewrap 0.6.1-1ubuntu0.1bubblewrap, sandboxed Codex tool calls started failing withbwrap: Unknown option --argv0bubblewrappackage restored normal behavior by forcing Codex to fall back to its bundled bubblewrapThis suggests the incompatibility is not limited to Ubuntu 20.04 /
bwrap 0.4.0; it also reproduces on Jammy with distrobubblewrap 0.6.1.In this environment, the failure appeared immediately after upgrading to
codex-cli 0.116.0and installing the distrobubblewrappackage.use_legacy_landlock = truein.codex/config.tomlworkaround this.Thanks, this did help on my WSL2 Ubuntu 22.04.5 setup with
codex-cli 0.116.0, just to add two details in case anyone's unaware (I was at first at least):[features]:[features]
use_legacy_landlock = true
.codex/config.tomlfixed direct CLI runs in that repo for me, but the chat-integrated/sandboxed tool path still appeared to use~/.codex/config.toml. So in my case I needed the same flag there as well.Edit:
Codex CLI Code reviews still failing for me unfortunately.
unexpected argument '--sandbox-policy-cwd'thereso how we can fix this?
I compiled
bwrap0.11.0 from source and installed it to/usr/bin/bwrap. It seems to work.Fun fact: apparently
codexdoesn't usePATHto findbwrapand just unconditionally uses/usr/bin/bwrap.And the reason is known and due to AppArmor. The 0.115 build caused some issues to AppArmor users and the 0.116 build that fixed that is now causing issues to all of us using an older system version of bwrap due to older OS.
Since they mark other issues duplicate of this one, I'm sure they are well aware now and will find the middle ground in 0.117.
Use a newer
bubblewrapand point/usr/bin/bwrapto it.On Ubuntu 22.04, the system package was too old and did not support
--argv0, which caused Codex/Coral sandboxed commands to fail with:Fix:
bubblewrapto/usr/local/bin/bwrapVerify:
Expected result:
/usr/bin/bwrapreports the new version--argv0appears in helpcodex sandbox linux /bin/truesucceedsRollback if needed:
They still haven't fix this crap? Embarrassing
Downgrading to 0.115 fixed it on Linux Mint 21.3 (Ubuntu 22.04-based)
Possible Workaround (seems working at Ubuntu 22.04.5 LTS):
Manually install new one. Symlink the old one(bubblewrap 0.6.1) to the new one(bubblewrap 0.10.0).
sudo apt install -y libcap-dev libseccomp-dev meson ninja-build pkg-config
cd /tmp
wget https://github.com/containers/bubblewrap/releases/download/v0.10.0/bubblewrap-0.10.0.tar.xz
tar xf bubblewrap-0.10.0.tar.xz
cd bubblewrap-0.10.0
meson setup build --prefix=/usr/local
ninja -C build
sudo ninja -C build install
sudo ln -sf /usr/local/bin/bwrap /usr/bin/bwrap