openai/codex · error · anyhow::Error

ditto copy failed with

Error message

ditto copy failed with {status}

What it means

Raised by copy_app_bundle when the macOS `ditto` command used to copy the .app bundle exits unsuccessfully (non-zero status or signal). The spawn itself succeeded; the copy operation failed, e.g. destination not writable or source missing. Caller install_codex_app_bundle propagates it as a failed install.

Solutions

  1. Ensure the destination Applications directory is writable
  2. Retry after freeing disk space
  3. Copy manually with `ditto <src>.app <dest>.app`
  4. Grant the terminal Full Disk Access if macOS blocks the copy
Defensive patterns

Strategy: retry

When it happens

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

Appendix: source

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

    anyhow::bail!(
        "no .app bundle found at {mount_point}",
        mount_point = mount_point.display()
    );
}

async fn copy_app_bundle(src_app: &Path, dest_app: &Path) -> anyhow::Result<()> {
    let status = Command::new("ditto")
        .arg(src_app)
        .arg(dest_app)
        .status()
        .await
        .context("failed to invoke `ditto`")?;

    if status.success() {
        return Ok(());
    }
    anyhow::bail!("ditto copy failed with {status}");
}

fn user_applications_dir() -> anyhow::Result<PathBuf> {
    let home = std::env::var_os("HOME").context("HOME is not set")?;
    Ok(PathBuf::from(home).join("Applications"))
}

fn parse_hdiutil_attach_mount_point(output: &str) -> Option<String> {
    output.lines().find_map(|line| {
        if !line.contains("/Volumes/") {
            return None;
        }
        if let Some((_, mount)) = line.rsplit_once('\t') {
            return Some(mount.trim().to_string());
        }
        line.split_whitespace()
            .find(|field| field.starts_with("/Volumes/"))
            .map(str::to_string)

View on GitHub (pinned to 339751715c)