openai/codex · error · SetupFailure

HelperSandboxLockFailed

HelperSandboxLockFailed

Error message

lock sandbox dir {} failed: {err}

What it means

Wrapper error: lock_sandbox_dir failed while applying the restrictive DACL to the persistent sandbox directory (the main codex sandbox home). The original error is chained under HelperSandboxLockFailed; the message itself only identifies which directory lock failed.

Solutions

  1. Inspect the chained error for the underlying SetEntriesInAclW/SetSecurityInfo failure code
  2. Run the setup elevated so DACL modification on the sandbox directory is permitted
  3. If the directory has a foreign owner or ACL, take ownership as administrator and re-run setup
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs:674 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/5831e8b9be9cbbee. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs:674

        |message| {
            let _ = log_line(log, message);
        },
    );
    Ok(())
}

fn lock_persistent_sandbox_dirs(payload: &Payload, sandbox_group_sid: &[u8]) -> Result<()> {
    lock_sandbox_dir(
        &sandbox_dir(&payload.codex_home),
        &payload.real_user,
        sandbox_group_sid,
        GRANT_ACCESS,
        FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE | DELETE,
        FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE,
        payload.mode,
    )
    .map_err(|err| {
        anyhow::Error::new(SetupFailure::new(
            SetupErrorCode::HelperSandboxLockFailed,
            format!(
                "lock sandbox dir {} failed: {err}",
                sandbox_dir(&payload.codex_home).display()
            ),
        ))
    })?;
    lock_sandbox_dir(
        &sandbox_secrets_dir(&payload.codex_home),
        &payload.real_user,
        sandbox_group_sid,
        DENY_ACCESS,
        FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE | DELETE,
        FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE,
        payload.mode,
    )
    .map_err(|err| {
        anyhow::Error::new(SetupFailure::new(

View on GitHub (pinned to 339751715c)