{"record":{"id":"044f3e0673f46d32","repo":"openai/codex","slug":"failed-to-read-synthetic-bubblewrap-mount-marker-d","errorCode":null,"errorMessage":"failed to read synthetic bubblewrap mount marker directory {}: {err}","messagePattern":"failed to read synthetic bubblewrap mount marker directory (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":1057,"sourceCode":"                \"failed to read synthetic bubblewrap mount marker {}: {err}\",\n                path.display()\n            ),\n        }\n    })\n}\n\nfn synthetic_mount_marker_dir_has_active_process(marker_dir: &Path) -> bool {\n    synthetic_mount_marker_dir_has_active_process_matching(marker_dir, |_| true)\n}\n\nfn synthetic_mount_marker_dir_has_active_process_matching(\n    marker_dir: &Path,\n    matches_marker: impl Fn(&Path) -> bool,\n) -> bool {\n    let entries = match fs::read_dir(marker_dir) {\n        Ok(entries) => entries,\n        Err(err) if err.kind() == std::io::ErrorKind::NotFound => return false,\n        Err(err) => panic!(\n            \"failed to read synthetic bubblewrap mount marker directory {}: {err}\",\n            marker_dir.display()\n        ),\n    };\n    for entry in entries {\n        let entry = entry.unwrap_or_else(|err| {\n            panic!(\n                \"failed to read synthetic bubblewrap mount marker in {}: {err}\",\n                marker_dir.display()\n            )\n        });\n        let path = entry.path();\n        let Some(pid) = path\n            .file_name()\n            .and_then(|name| name.to_str())\n            .and_then(|name| name.parse::<libc::pid_t>().ok())\n        else {\n            continue;","sourceCodeStart":1039,"sourceCodeEnd":1075,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L1039-L1075","documentation":"synthetic_mount_marker_dir_has_active_process_matching (linux_run_main.rs:1050) enumerates the marker directory to map marker filenames to PIDs, reap stale markers of dead PIDs, and decide whether the target still has active owners. read_dir failing with NotFound returns no-owners; every other errno panics: EACCES when directory permissions changed, ENOTDIR when a regular file exists where the hash-named directory should be (foreign file in the registry), or an I/O error.","triggerScenarios":"Any registration or cleanup of synthetic or protected targets whose hash-named registry entry exists as a file instead of a directory, has tightened permissions, or sits on failing storage.","commonSituations":"External tooling or debugging creating files inside the registry root; hand-placed artifacts; tmp cleaners leaving partial state; degraded disks.","solutions":["Inspect the printed path: if it is a regular file, remove it so the launcher can recreate the directory.","Restore directory permissions (chmod u+rx) on the marker dir.","With sessions stopped, reset the entire registry root.","Find and stop whatever writes foreign files into the registry."],"exampleFix":"# before: a plain file squats on the hash-named marker directory\nfile /tmp/codex-bwrap-synthetic-mount-targets-1000/0123abcd4567\n# ASCII text\n\n# after: remove the impostor (registry resets cleanly on next run)\nrm /tmp/codex-bwrap-synthetic-mount-targets-1000/0123abcd4567","handlingStrategy":"validation","validationCode":"fn registry_layout_ok() -> bool {\n    let root = std::env::temp_dir().join(format!(\n        \"codex-bwrap-synthetic-mount-targets-{}\",\n        unsafe { libc::geteuid() }\n    ));\n    match std::fs::read_dir(&root) {\n        Ok(entries) => entries.flatten().all(|e| e.path().is_dir() || e.file_name() == \"lock\"),\n        Err(_) => true,\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Forbid foreign processes from creating files inside the registry root.","Never place files with 16-hex-character names in the registry.","Reset the registry with sessions stopped instead of mutating it by hand."],"tags":["sandbox","registry","read-dir","enotdir","permissions","bubblewrap"],"backgroundTag":"not-a-directory-error","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}