{"record":{"id":"91041e896d999a5f","repo":"openai/codex","slug":"failed-to-lock-synthetic-bubblewrap-mount-registry","errorCode":null,"errorMessage":"failed to lock synthetic bubblewrap mount registry {}: {err}","messagePattern":"failed to lock synthetic bubblewrap mount registry (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":1316,"sourceCode":"            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        );\n    }\n    result\n}\n\nfn synthetic_mount_marker_dir(path: &Path) -> PathBuf {\n    synthetic_mount_registry_root().join(format!(\"{:016x}\", hash_path(path)))\n}","sourceCodeStart":1298,"sourceCodeEnd":1334,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L1298-L1334","documentation":"Taking the exclusive flock on the synthetic mount registry lock file failed. This panic in with_synthetic_mount_registry_lock fires when libc::flock(LOCK_EX) returns an error (e.g. EBADF, ENOLCK, or an interrupted lock on some filesystems like NFS without flock support), meaning concurrent cleanup serialization cannot be guaranteed and the registry operation aborts.","triggerScenarios":"Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the io::Error errno in the message","Avoid TMPDIR on filesystems lacking flock support (some network filesystems)","Move the registry to a local filesystem via TMPDIR","Retry if the error was transient (e.g. signal interruption)"],"exampleFix":null,"handlingStrategy":"retry","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"}