openai/codex · error · SetupFailure
HelperUsersFileWriteFailed
HelperUsersFileWriteFailed
Error message
failed to create secrets dir {}: {err} What it means
std::fs::create_dir_all failed while creating the sandbox secrets directory under codex home. The error is wrapped in HelperUsersFileWriteFailed because the secrets directory is a prerequisite for writing the DPAPI-protected user credential blobs, so user provisioning cannot complete without it.
Solutions
- Check the io::Error in the message: permission denied means the codex home ACL blocks the setup identity, and already-exists-as-file means a non-directory is in the way
- Create the parent codex home directory with appropriate permissions before running setup
- Remove any stale non-directory file occupying the secrets path and re-run setup
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs:414 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/c44bc74be39568e0.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs:414
offline_username: String,
online_username: String,
created_at: String,
proxy_ports: Vec<u16>,
allow_local_binding: bool,
read_roots: Vec<PathBuf>,
write_roots: Vec<PathBuf>,
}
fn write_secrets(
codex_home: &Path,
offline_user: &str,
offline_pwd: &str,
online_user: &str,
online_pwd: &str,
) -> Result<()> {
let secrets_dir = sandbox_secrets_dir(codex_home);
std::fs::create_dir_all(&secrets_dir).map_err(|err| {
anyhow::Error::new(SetupFailure::new(
SetupErrorCode::HelperUsersFileWriteFailed,
format!(
"failed to create secrets dir {}: {err}",
secrets_dir.display()
),
))
})?;
let offline_blob = dpapi_protect(offline_pwd.as_bytes()).map_err(|err| {
anyhow::Error::new(SetupFailure::new(
SetupErrorCode::HelperDpapiProtectFailed,
format!("dpapi protect failed for offline user: {err}"),
))
})?;
let online_blob = dpapi_protect(online_pwd.as_bytes()).map_err(|err| {
anyhow::Error::new(SetupFailure::new(
SetupErrorCode::HelperDpapiProtectFailed,
format!("dpapi protect failed for online user: {err}"),
))View on GitHub (pinned to 339751715c)