{"record":{"id":"bb061fddb4815132","repo":"openai/codex","slug":"could-not-find-home-directory","errorCode":null,"errorMessage":"Could not find home directory","messagePattern":"Could not find home directory","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/utils/home-dir/src/lib.rs","lineNumber":54,"sourceCode":"\n            if !metadata.is_dir() {\n                Err(std::io::Error::new(\n                    std::io::ErrorKind::InvalidInput,\n                    format!(\"CODEX_HOME points to {val:?}, but that path is not a directory\"),\n                ))\n            } else {\n                let canonical = path.canonicalize().map_err(|err| {\n                    std::io::Error::new(\n                        err.kind(),\n                        format!(\"failed to canonicalize CODEX_HOME {val:?}: {err}\"),\n                    )\n                })?;\n                AbsolutePathBuf::from_absolute_path(canonical)\n            }\n        }\n        None => {\n            let mut p = home_dir().ok_or_else(|| {\n                std::io::Error::new(\n                    std::io::ErrorKind::NotFound,\n                    \"Could not find home directory\",\n                )\n            })?;\n            p.push(\".codex\");\n            AbsolutePathBuf::from_absolute_path(p)\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::find_codex_home_from_env;\n    use codex_utils_absolute_path::AbsolutePathBuf;\n    use dirs::home_dir;\n    use pretty_assertions::assert_eq;\n    use std::fs;\n    use std::io::ErrorKind;","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/home-dir/src/lib.rs#L36-L72","documentation":"Error \"Could not find home directory\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/utils/home-dir/src/lib.rs:54 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"}