{"record":{"id":"fbe022bbb4ccaa9d","repo":"openai/codex","slug":"failed-to-register-synthetic-bubblewrap-mount-targ","errorCode":null,"errorMessage":"failed to register synthetic bubblewrap mount target {}: {err}","messagePattern":"failed to register synthetic bubblewrap mount target (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":978,"sourceCode":"                    && synthetic_mount_marker_dir_has_active_synthetic_owner(&marker_dir)\n                {\n                    match target.kind() {\n                        crate::bwrap::SyntheticMountTargetKind::EmptyFile => {\n                            crate::bwrap::SyntheticMountTarget::missing(target.path())\n                        }\n                        crate::bwrap::SyntheticMountTargetKind::EmptyDirectory => {\n                            crate::bwrap::SyntheticMountTarget::missing_empty_directory(\n                                target.path(),\n                            )\n                        }\n                    }\n                } else {\n                    target.clone()\n                };\n                let marker_file = marker_dir.join(std::process::id().to_string());\n                fs::write(&marker_file, synthetic_mount_marker_contents(&target)).unwrap_or_else(\n                    |err| {\n                        panic!(\n                            \"failed to register synthetic bubblewrap mount target {}: {err}\",\n                            target.path().display()\n                        )\n                    },\n                );\n                SyntheticMountTargetRegistration {\n                    target,\n                    marker_file,\n                    marker_dir,\n                }\n            })\n            .collect()\n    })\n}\n\nfn register_protected_create_targets(\n    targets: &[crate::bwrap::ProtectedCreateTarget],\n) -> Vec<ProtectedCreateTargetRegistration> {","sourceCodeStart":960,"sourceCodeEnd":996,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L960-L996","documentation":"After create_dir_all succeeds, the launcher writes the per-PID marker file (fs::write of marker_dir/<pid>) recording the target kind (SYNTHETIC vs EXISTING contents) used by owner checks and cleanup. The write panics on storage-level failures: ENOSPC or EDQUOT when the temp filesystem fills between create and write, EIO from failing storage. Registry mutations are flock-serialized across processes (with_synthetic_mount_registry_lock), so external racing is not the expected cause.","triggerScenarios":"A run with synthetic mount targets where the tmpfs or disk backing TMPDIR is exhausted or returns I/O errors exactly during registration, for example parallel sessions filling a size-capped /tmp.","commonSituations":"tmpfs /tmp with a small size= under concurrency; disk-full CI runners; degraded disks returning EIO; quota enforcement kicking in mid-write.","solutions":["Check and free space on the filesystem holding TMPDIR (df -h ${TMPDIR:-/tmp}), then retry.","If /tmp is tmpfs, remount with a larger size (mount -o remount,size=2G /tmp).","Check dmesg for I/O errors when the errno is not ENOSPC.","Retry once after space is freed; transient exhaustion from a finishing session clears itself."],"exampleFix":"# before: registry tmpfs fills under parallel sandboxed runs\nmount -t tmpfs -o size=512m tmpfs /tmp\n\n# after: headroom for marker files and synthetic targets\nmount -t tmpfs -o size=4g tmpfs /tmp","handlingStrategy":"validation","validationCode":"fn temp_free_bytes(min: u64) -> bool {\n    let dir = std::env::temp_dir().canonicalize().unwrap_or_default();\n    let c = std::ffi::CString::new(dir.as_os_str().as_encoded_bytes()).unwrap_or_default();\n    let mut st: libc::statvfs = unsafe { std::mem::zeroed() };\n    unsafe { libc::statvfs(c.as_ptr(), &mut st) } == 0 && (st.f_bavail as u64) * (st.f_bsize as u64) >= min\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor free space on TMPDIR and alert before exhaustion.","Size the /tmp tmpfs for peak concurrent sandbox usage.","Treat repeated ENOSPC under concurrency as a capacity signal and bound parallelism."],"tags":["sandbox","registry","marker-file","enospc","tmpfs","write-failure","bubblewrap"],"backgroundTag":"no-space-left-on-device","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}