openai/codex · error · anyhow::Error

failed to install Codex.app to any applications directory

Error message

failed to install Codex.app to any applications directory

What it means

install_codex_app_bundle exhausted every candidate Applications directory: Codex.app was absent and each copy_app_bundle attempt failed (a warning was printed per directory). It is an aggregate installation failure, typically permissions or a full disk.

Solutions

  1. Check the per-directory warnings above for the underlying copy error
  2. Ensure write permission on ~/Applications or /Applications
  3. Free disk space and retry
  4. Copy Codex.app from the mounted DMG manually
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at codex-rs/cli/src/desktop_app/mac.rs:226 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/d73b10a1e69db0d7. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/cli/src/desktop_app/mac.rs:226

        })?;

        let dest_app = applications_dir.join("Codex.app");
        if dest_app.is_dir() {
            return Ok(dest_app);
        }

        match copy_app_bundle(app_in_volume, &dest_app).await {
            Ok(()) => return Ok(dest_app),
            Err(err) => {
                eprintln!(
                    "warning: failed to install Codex.app to {applications_dir}: {err}",
                    applications_dir = applications_dir.display()
                );
            }
        }
    }

    anyhow::bail!("failed to install Codex.app to any applications directory");
}

fn candidate_applications_dirs() -> anyhow::Result<Vec<PathBuf>> {
    let mut dirs = vec![PathBuf::from("/Applications")];
    dirs.push(user_applications_dir()?);
    Ok(dirs)
}

async fn download_dmg(url: &str, dest: &Path) -> anyhow::Result<()> {
    eprintln!("Downloading installer...");
    let status = Command::new("curl")
        .arg("-fL")
        .arg("--retry")
        .arg("3")
        .arg("--retry-delay")
        .arg("1")
        .arg("-o")
        .arg(dest)

View on GitHub (pinned to 339751715c)