{"record":{"id":"0877e5d320de7325","repo":"openai/codex","slug":"failed-to-resolve-synthetic-mount-registry-temp-di","errorCode":null,"errorMessage":"failed to resolve synthetic mount registry temp directory {}: {err}","messagePattern":"failed to resolve synthetic mount registry temp directory (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":1344,"sourceCode":"            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}\n\npub(crate) fn synthetic_mount_registry_root() -> PathBuf {\n    static REGISTRY_ROOT: OnceLock<PathBuf> = OnceLock::new();\n\n    REGISTRY_ROOT\n        .get_or_init(|| {\n            let effective_uid = unsafe { libc::geteuid() };\n            let temp_dir = std::env::temp_dir();\n            let temp_dir = temp_dir.canonicalize().unwrap_or_else(|err| {\n                panic!(\n                    \"failed to resolve synthetic mount registry temp directory {}: {err}\",\n                    temp_dir.display()\n                )\n            });\n            let registry_root = temp_dir.join(format!(\n                \"codex-bwrap-synthetic-mount-targets-{effective_uid}\"\n            ));\n            // A registry symlink can redirect bookkeeping into a writable root\n            // that does not overlap TMPDIR, bypassing its read-only mount.\n            assert!(\n                !registry_root.is_symlink(),\n                \"synthetic mount registry must not be a symlink: {}\",\n                registry_root.display()\n            );\n            registry_root\n        })\n        .clone()\n}","sourceCodeStart":1326,"sourceCodeEnd":1362,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L1326-L1362","documentation":"Canonicalizing the temp directory failed while resolving where the synthetic mount registry lives. This panic in synthetic_mount_registry_root fires when std::env::temp_dir().canonicalize() errors — the temp path exists per env but cannot be resolved to a real path (deleted TMPDIR, symlink loops, permission issues) — so the registry root cannot be established for this uid.","triggerScenarios":"Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1344 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify TMPDIR points to an existing, accessible directory","Recreate the temp directory if it was deleted out from under the process","Fix or remove cyclic symlinks in the temp path","Set TMPDIR to a simple local path"],"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"}