openai/codex · error

failed to create synthetic bubblewrap mount registry

Error message

failed to create synthetic bubblewrap mount registry {}: {err}

What it means

Creating the per-user synthetic mount registry directory under the temp dir failed. This panic in with_synthetic_mount_registry_lock fires when fs::create_dir_all on the registry root (keyed by effective uid) errors — e.g. TMPDIR unwritable, stale ownership, or disk full — so no marker files or locks can be set up and every synthetic-mount operation is impossible.

Solutions

  1. Check that TMPDIR (or /tmp) exists and is writable by the current uid
  2. Clear stale registry directories with mismatched ownership under the temp root
  3. Free disk space if the filesystem is full
  4. Set TMPDIR to a writable location if the default is restricted
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1296 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/c62943e37da58bc3. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1296

                path.display()
            ),
        },
    }
}

fn process_is_active(pid: libc::pid_t) -> bool {
    let result = unsafe { libc::kill(pid, 0) };
    if result == 0 {
        return true;
    }
    let err = std::io::Error::last_os_error();
    !matches!(err.raw_os_error(), Some(libc::ESRCH))
}

fn with_synthetic_mount_registry_lock<T>(f: impl FnOnce() -> T) -> T {
    let registry_root = synthetic_mount_registry_root();
    fs::create_dir_all(&registry_root).unwrap_or_else(|err| {
        panic!(
            "failed to create synthetic bubblewrap mount registry {}: {err}",
            registry_root.display()
        )
    });
    let lock_path = registry_root.join("lock");
    let lock_file = OpenOptions::new()
        .read(true)
        .write(true)
        .create(true)
        .truncate(false)
        .open(&lock_path)
        .unwrap_or_else(|err| {
            panic!(
                "failed to open synthetic bubblewrap mount registry lock {}: {err}",
                lock_path.display()
            )
        });
    if unsafe { libc::flock(lock_file.as_raw_fd(), libc::LOCK_EX) } < 0 {

View on GitHub (pinned to 339751715c)