{"record":{"id":"cfeff7dad99c83e7","repo":"openai/codex","slug":"failed-to-unregister-protected-create-target","errorCode":null,"errorMessage":"failed to unregister protected create target {}: {err}","messagePattern":"failed to unregister protected create target (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":1133,"sourceCode":"                Ok(()) => {}\n                Err(err) if err.kind() == std::io::ErrorKind::NotFound => {}\n                Err(err) if err.kind() == std::io::ErrorKind::DirectoryNotEmpty => {}\n                Err(err) => panic!(\n                    \"failed to remove synthetic bubblewrap mount marker directory {}: {err}\",\n                    target.marker_dir.display()\n                ),\n            }\n        }\n    });\n}\n\nfn cleanup_protected_create_targets(targets: &[ProtectedCreateTargetRegistration]) -> bool {\n    with_synthetic_mount_registry_lock(|| {\n        for target in targets.iter().rev() {\n            match fs::remove_file(&target.marker_file) {\n                Ok(()) => {}\n                Err(err) if err.kind() == std::io::ErrorKind::NotFound => {}\n                Err(err) => panic!(\n                    \"failed to unregister protected create target {}: {err}\",\n                    target.target.path().display()\n                ),\n            }\n        }\n\n        let mut violation = false;\n        for target in targets.iter().rev() {\n            violation |= remove_protected_create_target(&target.target);\n            match fs::remove_dir(&target.marker_dir) {\n                Ok(()) => {}\n                Err(err) if err.kind() == std::io::ErrorKind::NotFound => {}\n                Err(err) if err.kind() == std::io::ErrorKind::DirectoryNotEmpty => {}\n                Err(err) => panic!(\n                    \"failed to remove protected create marker directory {}: {err}\",\n                    target.marker_dir.display()\n                ),\n            }","sourceCodeStart":1115,"sourceCodeEnd":1151,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L1115-L1151","documentation":"Unregistering a protected-create target's marker file failed during cleanup. This panic in cleanup_protected_create_targets fires when removing the marker file errors with anything other than NotFound, indicating filesystem-level failure (permissions, IO error) while tearing down the write-protection scaffolding created around bwrap's protected create mounts.","triggerScenarios":"Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the io::Error errno embedded in the message","Confirm the protected-create marker files are writable/removable by the current uid","Clear the marker registry manually while no sandbox is running","Check for disk/IO issues if errors persist"],"exampleFix":null,"handlingStrategy":"try-catch","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"}