{"record":{"id":"22d0bda77b1c715f","repo":"openai/codex","slug":"failed-to-remove-protected-create-target-err","errorCode":null,"errorMessage":"failed to remove protected create target {}: {err}","messagePattern":"failed to remove protected create target (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":1165,"sourceCode":"                Err(err) => panic!(\n                    \"failed to remove protected create marker directory {}: {err}\",\n                    target.marker_dir.display()\n                ),\n            }\n        }\n        violation\n    })\n}\n\nfn remove_protected_create_target(target: &crate::bwrap::ProtectedCreateTarget) -> bool {\n    for attempt in 0..100 {\n        match try_remove_protected_create_target(target) {\n            Ok(removal) => return removal.is_some(),\n            Err(err) if err.kind() == std::io::ErrorKind::DirectoryNotEmpty && attempt < 99 => {\n                thread::sleep(Duration::from_millis(1));\n            }\n            Err(err) => {\n                panic!(\n                    \"failed to remove protected create target {}: {err}\",\n                    target.path().display()\n                );\n            }\n        }\n    }\n    unreachable!(\"protected create removal retry loop should return or panic\")\n}\n\nfn remove_protected_create_target_best_effort(\n    target: &crate::bwrap::ProtectedCreateTarget,\n) -> Option<ProtectedCreateRemoval> {\n    for _ in 0..100 {\n        match try_remove_protected_create_target(target) {\n            Ok(removal) => return removal,\n            Err(err) if err.kind() == std::io::ErrorKind::DirectoryNotEmpty => {\n                thread::sleep(Duration::from_millis(1));\n            }","sourceCodeStart":1147,"sourceCodeEnd":1183,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L1147-L1183","documentation":"Error \"failed to remove protected create target {}: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}