{"record":{"id":"d64c302ecdb8ad76","repo":"openai/codex","slug":"path-is-not-a-regular-file-d64c30","errorCode":null,"errorMessage":"path `{}` is not a regular file","messagePattern":"path `(.+?)` is not a regular file","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/exec-server/src/regular_file.rs","lineNumber":39,"sourceCode":"pub async fn read_sensitive_file_to_string(path: &Path) -> io::Result<String> {\n    let mut options = tokio::fs::OpenOptions::new();\n    options.read(true);\n    configure_open(&mut options);\n\n    #[cfg(unix)]\n    options.custom_flags(libc::O_NONBLOCK | libc::O_NOFOLLOW);\n\n    #[cfg(windows)]\n    {\n        use windows_sys::Win32::Storage::FileSystem::FILE_FLAG_OPEN_REPARSE_POINT;\n\n        options.custom_flags(FILE_FLAG_OPEN_REPARSE_POINT);\n    }\n\n    let mut file = options.open(path).await?;\n    let metadata = file.metadata().await?;\n    if !is_disk_file(&file) || !metadata.is_file() || metadata.file_type().is_symlink() {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidInput,\n            format!(\"path `{}` is not a regular file\", path.display()),\n        ));\n    }\n\n    let mut contents = String::new();\n    file.read_to_string(&mut contents).await?;\n    Ok(contents)\n}\n\n#[cfg(unix)]\nfn configure_open(options: &mut tokio::fs::OpenOptions) {\n    options.custom_flags(libc::O_NONBLOCK);\n}\n\n#[cfg(windows)]\nfn configure_open(options: &mut tokio::fs::OpenOptions) {\n    use windows_sys::Win32::Storage::FileSystem::SECURITY_IDENTIFICATION;","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/exec-server/src/regular_file.rs#L21-L57","documentation":"Error \"path `{}` is not a regular file\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/exec-server/src/regular_file.rs:39 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"}