{"record":{"id":"0d26ec1e7e6eb40c","repo":"openai/codex","slug":"credentials-path-is-not-a-regular-file","errorCode":null,"errorMessage":"credentials path is not a regular file","messagePattern":"credentials path is not a regular file","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/oauth.rs","lineNumber":1040,"sourceCode":"\nfn open_fallback_file_for_write(path: &std::path::Path) -> Result<fs::File> {\n    let mut options = fs::OpenOptions::new();\n    options.write(true).create(true).truncate(false);\n    #[cfg(unix)]\n    {\n        use std::os::unix::fs::OpenOptionsExt;\n        options\n            .mode(0o600)\n            .custom_flags(libc::O_NOFOLLOW | libc::O_NONBLOCK);\n    }\n    #[cfg(windows)]\n    {\n        use std::os::windows::fs::OpenOptionsExt;\n        use windows_sys::Win32::Storage::FileSystem::FILE_FLAG_OPEN_REPARSE_POINT;\n        options.custom_flags(FILE_FLAG_OPEN_REPARSE_POINT);\n    }\n    let file = options.open(path)?;\n    anyhow::ensure!(\n        file.metadata()?.is_file(),\n        \"credentials path is not a regular file\"\n    );\n    Ok(file)\n}\n\nfn write_fallback_file(store: &FallbackFile) -> Result<()> {\n    let path = fallback_file_path()?;\n\n    if store.is_empty() {\n        if path.exists() {\n            fs::remove_file(path)?;\n        }\n        return Ok(());\n    }\n\n    let parent = path\n        .parent()","sourceCodeStart":1022,"sourceCodeEnd":1058,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/oauth.rs#L1022-L1058","documentation":"Error \"credentials path is not a regular file\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/oauth.rs:1040 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"}