{"record":{"id":"d408ba785a691310","repo":"openai/codex","slug":"failed-to-open-synthetic-bubblewrap-mount-registry","errorCode":null,"errorMessage":"failed to open synthetic bubblewrap mount registry lock {}: {err}","messagePattern":"failed to open synthetic bubblewrap mount registry lock (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":1309,"sourceCode":"}\n\nfn with_synthetic_mount_registry_lock<T>(f: impl FnOnce() -> T) -> T {\n    let registry_root = synthetic_mount_registry_root();\n    fs::create_dir_all(&registry_root).unwrap_or_else(|err| {\n        panic!(\n            \"failed to create synthetic bubblewrap mount registry {}: {err}\",\n            registry_root.display()\n        )\n    });\n    let lock_path = registry_root.join(\"lock\");\n    let lock_file = OpenOptions::new()\n        .read(true)\n        .write(true)\n        .create(true)\n        .truncate(false)\n        .open(&lock_path)\n        .unwrap_or_else(|err| {\n            panic!(\n                \"failed to open synthetic bubblewrap mount registry lock {}: {err}\",\n                lock_path.display()\n            )\n        });\n    if unsafe { libc::flock(lock_file.as_raw_fd(), libc::LOCK_EX) } < 0 {\n        let err = std::io::Error::last_os_error();\n        panic!(\n            \"failed to lock synthetic bubblewrap mount registry {}: {err}\",\n            lock_path.display()\n        );\n    }\n    let result = f();\n    if unsafe { libc::flock(lock_file.as_raw_fd(), libc::LOCK_UN) } < 0 {\n        let err = std::io::Error::last_os_error();\n        panic!(\n            \"failed to unlock synthetic bubblewrap mount registry {}: {err}\",\n            lock_path.display()\n        );","sourceCodeStart":1291,"sourceCodeEnd":1327,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L1291-L1327","documentation":"Opening the lock file for the synthetic mount registry failed. This panic in with_synthetic_mount_registry_lock fires when OpenOptions::open on registry_root/lock errors — permissions problems or filesystem failures on the temp dir — so mutual exclusion between concurrent sandbox cleanups cannot be established and the operation aborts.","triggerScenarios":"Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check permissions on the registry lock file and its directory for the current uid","Remove a stale lock file with wrong ownership while no sandbox is running","Verify the temp filesystem is writable and healthy","Point TMPDIR at a writable location"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}