Codex is looking for bwrap in wrong place
What version of the Codex App are you using (From “About Codex” dialog)?
0.116.0 CLI
What subscription do you have?
Pro
What platform is your computer?
Ubuntu
What issue are you seeing?
I have the bubblewrap installed, but I'm unable to install it to the location that Codex is looking for it at. So I still get this error: ⚠ Codex could not find system bubblewrap at /usr/bin/bwrap. Please install bubblewrap with your package manager. Codex will use the vendored bubblewrap in the meantime.
The issue is that Codex is looking specifically at /usr/bin/bwrap, but since bubblewrap was installed via Nix, the binary lives in the Nix store — not in /usr/bin. Both /usr/bin and /usr/local/bin are read-only in this environment, so we can't place a symlink there for Codex to find.
And it seems there are permission issues related to using the vendor bubblewrap because I'm unable to do code reviews using /review. Everything works in 0.114.0. But I have lots of bwrap related problems with 0.115.0, which was unusable. And still in 0.116.0, I have these problems, though it seems to run better than the previous version. I've had to go back to using 0.114.0.
What steps can reproduce the bug?
Just have bubblewrap installed in a location different than where Codex is looking for.
What is the expected behavior?
_No response_
Additional information
_No response_
15 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Yes, system
bwrapshould be looked up in$PATH, not assumed to be in/usr/bin/bwrap.Confirmed root cause + Ubuntu 20.04 workaround
Investigated this on Ubuntu 20.04.6 LTS aarch64. A few findings that might help clarify the issue and help people on Ubuntu 20.04 specifically.
Hardcoded path confirmed via
stringsCodex does not use
$PATHto locate bwrap — the path/usr/bin/bwrapis hardcoded in the native binary. This explains why placing a newer bwrap at/usr/local/bin/bwrap, prependingPATH, or settingBWRAP=/BUBBLEWRAP=environment variables has no effect, as several people have noted in #15291 and #15283.Why the embedded fallback doesn't help on Ubuntu 20.04
Codex ships a vendored bwrap and falls back to it only when no system bwrap is found at
/usr/bin/bwrap. A present-but-broken/usr/bin/bwrap(e.g. Ubuntu 20.04's 0.4.0) blocks the fallback entirely. You get the worst of both worlds: the system bwrap is too old to work, and the bundled one is never used.Workaround for Ubuntu 20.04 (requires root)
Since Ubuntu 20.04 focal won't receive a bwrap backport and
apt upgradeis a dead end, the only reliable fix is to build a newer bwrap from source and install it to/usr/bin/bwrap. Thedpkg-divertstep is important — without it, anyapt upgradeorapt install bubblewrapwill silently overwrite your newer binary with 0.4.0 again.To revert:
Tested on Ubuntu 20.04.6 aarch64, Codex 0.116.0. Also works on x86_64 focal.
This happened after updating codex. Is this specifically causing by codex after a version? I may try to downgrade codex
I use Homebrew on Linux and had the same problem
114 works fine for me. Problems started at 115 and continue with 116.
Yes, I forgot to update my progress! In fact I am using version 0.114.0 now and works well lol. Anyone with the same problem could try this:
This also means that, Codex newest version is not stable. Hope they can fix bugs soon
Wish I found this before digging deep.
PopOS 22.04 also having this issue due bwrap version 0.6. PATHS don't work. Was about to nuke my bwrap to test if Codex can even do a fall over to it's bwrap.
Can confirm downgrading works. Seems it's related to how they're passing args to bwrap.
Hope they fix this ASAP. We should be allowed to use the builtin bwrap.
/expirmental and /collab also silently fail. I thought the features where broken. Guessing these are using bwrap for the multi agent flow.
Confirming this on NixOS as well.
Environment:
codex-cli 0.116.0nixos-version:25.11.20260316.48652e9 (Xantusia)command -v bwrap:/home/exec/.nix-profile/bin/bwrapOn NixOS,
/usr/binis generally not populated, so looking specifically for/usr/bin/bwrapis not a valid check.bwrapcan be installed and available onPATH, but Codex still prints:Expected behavior: detect
bwrapfromPATH(or otherwise avoid assuming/usr/bin/bwrapexists) instead of hard-coding a FHS path.The
bwrapPATH lookup fix merged in #15791 and is available in 0.117.0-alpha.25. If you're installingbwrapoutside/usr/bin(for example Nix, Homebrew on Linux, or/usr/local/bin), can you try 0.117.0-alpha.25 or newer and confirm Codex picks it up fromPATH?If it still fails, please share
which bwrapandcodex --version.It still fails in 0.117.0-alpha.25.
This version fails to find the system bwrap whenever PATH contains multiple paths.
@frangio can you print out
which bwrapand$PATH (redacted, I only need to see bwrap versions)After digging further, I think this breaks down into two distinct issues.
First, #15340 is a real system-
bwrapdiscovery bug. In released Codex 0.116.0 and 0.117.0, the Linux sandbox code looks for system bubblewrap at/usr/bin/bwrap, which breaks Nix-based environments like Replit wherebwrapis onPATHbut not installed under/usr/bin. Upstream has already merged #15791 to switch lookup toPATH, and follow-up #15973 says the first PATH-based implementation still failed on normal multi-entryPATHvalues and was still reproducing #15340. So “bwrapis installed and visible on PATH, but Codex still says it cannot find it” is a valid Codex bug, not just a Replit quirk. ([GitHub][1])Second, there is a separate sandbox-backend compatibility problem in Replit. Replit documents Nix-managed workspace packages through
replit.nix, which is exactly the kind of setup where a tool is available in the shell without living under/usr/bin. But Codex’s 0.117 Linux sandbox docs also say the default bubblewrap pipeline explicitly uses--unshare-userand--unshare-pid, and bubblewrap’s own man page says the user namespace is required unlessbwrapis installed setuid root. In my Replit workspace, runningbwrapdirectly fails with “No permissions to create a new namespace,” so even after PATH discovery is fixed, the default Codex bubblewrap backend still appears incompatible with a standard unprivileged Replit workspace. Open #15893 is adding a clearer warning for exactly this class of failure. ([Replit Docs][2])So the most accurate conclusion is: #15340 is real, but it is only one layer of the problem. Fixing system-
bwraplookup is necessary, but not sufficient, for Replit. There also appears to be an environment-level incompatibility with Codex’s default non-setuid bubblewrap sandbox. ([GitHub][3])For historical context, this also matches the regression I saw across versions: 0.115 switched the default filesystem sandbox to bubblewrap while keeping the legacy Landlock fallback available via
features.use_legacy_landlock = trueor-c use_legacy_landlock=true. That helps explain why 0.114 worked in this environment while 0.115+ started failing. ([GitHub][4])My request would be to treat these as separate issues:
bwrapfromPATHcorrectly,Codex’s default bubblewrap backend appears incompatible with a standard unprivileged Replit workspace. [Ubuntu Manpages][5])
Environment:
Replit (NixOS-based container)
Codex version: 0.117.0
bwrap --version: bubblewrap 0.8.0 (installed via Nix, available on PATH)
@viyatb-oai Try any PATH variable with multiple paths in it separated by colons. The code isn't getting to the search part because
join_pathsfails.@bromdun I'm going to fix the Replit like issue separately