openai/codex · error · anyhow::Error

path does not exist

Error message

path does not exist: {}

What it means

Validation guard in grant_read_root_non_elevated: the read_root path passed for the Windows sandbox setup does not exist on disk, so granting read ACLs on it would silently produce an ineffective permission entry.

Solutions

  1. Create the directory before running sandbox setup
  2. Correct the configured workspace/read-root path to an existing directory
  3. Skip granting read access for nonexistent roots and warn instead
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/tui/src/windows_sandbox.rs:105 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/d5baafb3bd85d3f7. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/tui/src/windows_sandbox.rs:105

    } else {
        "codex.windows_sandbox.elevated_setup_failure"
    }
}

#[cfg(target_os = "windows")]
pub(crate) fn grant_read_root_non_elevated(
    permission_profile: &PermissionProfile,
    workspace_roots: &[AbsolutePathBuf],
    command_cwd: &Path,
    env_map: &HashMap<String, String>,
    codex_home: &Path,
    read_root: &Path,
) -> anyhow::Result<PathBuf> {
    if !read_root.is_absolute() {
        anyhow::bail!("path must be absolute: {}", read_root.display());
    }
    if !read_root.exists() {
        anyhow::bail!("path does not exist: {}", read_root.display());
    }
    if !read_root.is_dir() {
        anyhow::bail!("path must be a directory: {}", read_root.display());
    }

    let canonical_root = dunce::canonicalize(read_root)?;
    codex_windows_sandbox::run_setup_refresh_with_extra_read_roots(
        permission_profile,
        workspace_roots,
        command_cwd,
        env_map,
        codex_home,
        vec![canonical_root.clone()],
        /*proxy_enforced*/ false,
    )?;
    Ok(canonical_root)
}

View on GitHub (pinned to 339751715c)