{"record":{"id":"55950bc969860266","repo":"openai/codex","slug":"no-home-dir","errorCode":null,"errorMessage":"no home dir","messagePattern":"no home dir","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/env.rs","lineNumber":109,"sourceCode":"        .into_iter()\n        .enumerate()\n        .filter(|(i, _)| {\n            let up = &exts_norm[*i];\n            up != \".BAT\" && up != \".CMD\"\n        })\n        .map(|(_, e)| e)\n        .collect();\n    let mut combined = Vec::new();\n    combined.extend(front);\n    combined.extend(rest);\n    env_map.insert(\"PATHEXT\".into(), combined.join(\";\"));\n}\n\nfn ensure_denybin(tools: &[&str], denybin_dir: Option<&Path>) -> Result<PathBuf> {\n    let base = match denybin_dir {\n        Some(p) => p.to_path_buf(),\n        None => {\n            let home = home_dir().ok_or_else(|| anyhow!(\"no home dir\"))?;\n            home.join(\".sbx-denybin\")\n        }\n    };\n    fs::create_dir_all(&base)?;\n    for tool in tools {\n        for ext in [\".bat\", \".cmd\"] {\n            let path = base.join(format!(\"{tool}{ext}\"));\n            if !path.exists() {\n                let mut f = File::create(&path)?;\n                f.write_all(b\"@echo off\\\\r\\\\nexit /b 1\\\\r\\\\n\")?;\n            }\n        }\n    }\n    Ok(base)\n}\n\npub fn apply_no_network_to_env(env_map: &mut HashMap<String, String>) -> Result<()> {\n    env_map.insert(\"SBX_NONET_ACTIVE\".into(), \"1\".into());","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/env.rs#L91-L127","documentation":"home_dir() returned None while materializing the deny-bin directory, so no base path exists under which to create denylisted-tool shims. The user profile is unavailable (HOME/USERPROFILE unset or unreadable).","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/env.rs:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HOME (Unix) or USERPROFILE (Windows) in the execution environment","Pass an explicit denybin_dir instead of relying on the home directory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}