{"record":{"id":"c44b6cbb42bafb75","repo":"openai/codex","slug":"path-is-not-a-regular-file","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/no_follow/unix.rs","lineNumber":108,"sourceCode":"    Ok((directory, leaf))\n}\n\nfn open_entry_sync(path: &Path) -> io::Result<std::fs::File> {\n    let (parent, leaf) = parent(path)?;\n    let file = openat(\n        &parent,\n        leaf,\n        OFlags::RDONLY | OFlags::NOFOLLOW | OFlags::NONBLOCK | OFlags::CLOEXEC,\n        Mode::empty(),\n    )\n    .map_err(io::Error::from)?;\n    Ok(std::fs::File::from(file))\n}\n\nfn open_file_sync(path: &Path) -> io::Result<std::fs::File> {\n    let file = open_entry_sync(path)?;\n    if !file.metadata()?.is_file() {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidInput,\n            \"path is not a regular file\",\n        ));\n    }\n    Ok(file)\n}\n\npub(super) async fn open_file(path: PathBuf) -> io::Result<tokio::fs::File> {\n    tokio::task::spawn_blocking(move || open_file_sync(&path).map(tokio::fs::File::from_std))\n        .await\n        .map_err(|error| io::Error::other(format!(\"filesystem task failed: {error}\")))?\n}\n\npub(super) async fn write_file(path: PathBuf, contents: Vec<u8>) -> io::Result<()> {\n    tokio::task::spawn_blocking(move || {\n        let (parent, leaf) = parent(&path)?;\n        // Prevent FIFOs and devices from blocking during open before the\n        // descriptor can be validated as a regular file below.","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/exec-server/src/no_follow/unix.rs#L90-L126","documentation":"Error \"path is not a regular file\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/exec-server/src/no_follow/unix.rs:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the operation at a regular file, not a directory or special file."],"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"}