openai/codex · error
failed to exec system bubblewrap
Error message
failed to exec system bubblewrap {program_path}: {err} What it means
The execv syscall into the system bubblewrap binary failed, meaning the sandboxed child could never be launched. This panic in exec_system_bwrap fires immediately after execv returns (execv only returns on failure); the errno explains why — commonly ENOENT (binary moved), EACCES (not executable), or resource exhaustion. The sandbox process aborts because there is no safe way to continue.
Solutions
- Check the errno in the message: ENOENT means the bwrap path is stale, EACCES means missing execute permission
- Verify bubblewrap is installed and executable at the resolved path
- Free up system resources if the error indicates memory/process limits
- Ensure the binary matches the host architecture and is not a broken symlink
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/linux-sandbox/src/launcher.rs:232 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/483c135264beaa89.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/linux-sandbox/src/launcher.rs:232
let program_path = program.as_path().display().to_string();
let program = CString::new(program.as_path().as_os_str().as_bytes())
.unwrap_or_else(|err| panic!("invalid system bubblewrap path: {err}"));
let cstrings = argv_to_cstrings(&argv);
let mut argv_ptrs: Vec<*const c_char> = cstrings
.iter()
.map(CString::as_c_str)
.map(CStr::as_ptr)
.collect();
argv_ptrs.push(std::ptr::null());
// SAFETY: `program` and every entry in `argv_ptrs` are valid C strings for
// the duration of the call. On success `execv` does not return.
unsafe {
libc::execv(program.as_ptr(), argv_ptrs.as_ptr());
}
let err = std::io::Error::last_os_error();
panic!("failed to exec system bubblewrap {program_path}: {err}");
}
#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
use std::os::unix::fs::PermissionsExt;
use tempfile::NamedTempFile;
#[test]
fn prefers_system_bwrap_when_help_lists_argv0() {
let fake_bwrap = NamedTempFile::new().expect("temp file");
let fake_bwrap_path = fake_bwrap.path();
let expected = AbsolutePathBuf::from_absolute_path(fake_bwrap_path).expect("absolute");
assert_eq!(
system_bwrap_launcher_for_path_with_probe(fake_bwrap_path, |_| {
Some(SystemBwrapCapabilities {View on GitHub (pinned to 339751715c)