jdx/mise · error

mas install failed: {}

Error message

mas install failed: {}

What it means

After spawning `mas install <ids>`, install() checks the exit status and bails with this error carrying mas's trimmed stderr when the command fails. The cause is whatever mas itself reported (auth, network, app not available).

Source

Thrown at src/system/packages/mas.rs:276

        }
        if let Some(p) = pkgs.iter().find(|p| !is_adam_id(&p.name)) {
            bail!("mas install requires a numeric ADAM ID ('{p}'); use `mas search` to find it");
        }
        let mut args = vec!["install".to_string()];
        args.extend(pkgs.iter().map(|p| p.name.clone()));
        if opts.dry_run {
            miseprintln!("mas {}", args.join(" "));
            return Ok(());
        }
        debug!("$ mas {}", args.join(" "));
        let output = tokio::process::Command::new(self.bin().await?)
            .args(&args)
            .stdin(Stdio::null())
            .output()
            .await?;
        if !output.status.success() {
            let stderr = String::from_utf8_lossy(&output.stderr);
            bail!("mas install failed: {}", stderr.trim());
        }
        Ok(())
    }

    async fn upgrade(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {
        if let Some(p) = pkgs.iter().find(|p| !is_adam_id(&p.name)) {
            bail!("mas upgrade requires a numeric ADAM ID ('{p}'); use `mas search` to find it");
        }
        let mut args = vec!["upgrade".to_string()];
        args.extend(pkgs.iter().map(|p| p.name.clone()));
        if opts.dry_run {
            miseprintln!("mas {}", args.join(" "));
            return Ok(());
        }
        debug!("$ mas {}", args.join(" "));
        let output = tokio::process::Command::new(self.bin().await?)
            .args(&args)
            .stdin(Stdio::null())

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Read the stderr in the error message for mas's own explanation
  2. Verify sign-in with `mas account` and that the Apple ID owns/has accepted the app
  3. Confirm the ADAM ID is correct via `mas search`
  4. Retry later if App Store services are down
Defensive patterns

Strategy: try-catch

Validate before calling

mas account >/dev/null 2>&1 && mas list >/dev/null 2>&1 && echo "mas ready"

Try / catch

if let Err(e) = provider.install(&pkgs, &opts).await {
    if e.to_string().contains("mas install failed") {
        eprintln!("check Apple ID ownership/region for {ids:?}: {e}");
    }
}

Prevention

When it happens

Trigger: `mas install` exits non-zero — app not purchasable/available in the current Apple ID region, not signed in, App Store servers erroring, or the ADAM ID not owned by the signed-in account.

Common situations: Installing an app the signed-in Apple ID never purchased (mas can only 'install' previously purchased apps); App Store outage; regional availability restrictions; acceptance of new Apple terms pending.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/0175937b52a0b83a. Report an issue: GitHub.