{"record":{"id":"0175937b52a0b83a","repo":"jdx/mise","slug":"mas-install-failed","errorCode":null,"errorMessage":"mas install failed: {}","messagePattern":"mas install failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/mas.rs","lineNumber":276,"sourceCode":"        }\n        if let Some(p) = pkgs.iter().find(|p| !is_adam_id(&p.name)) {\n            bail!(\"mas install requires a numeric ADAM ID ('{p}'); use `mas search` to find it\");\n        }\n        let mut args = vec![\"install\".to_string()];\n        args.extend(pkgs.iter().map(|p| p.name.clone()));\n        if opts.dry_run {\n            miseprintln!(\"mas {}\", args.join(\" \"));\n            return Ok(());\n        }\n        debug!(\"$ mas {}\", args.join(\" \"));\n        let output = tokio::process::Command::new(self.bin().await?)\n            .args(&args)\n            .stdin(Stdio::null())\n            .output()\n            .await?;\n        if !output.status.success() {\n            let stderr = String::from_utf8_lossy(&output.stderr);\n            bail!(\"mas install failed: {}\", stderr.trim());\n        }\n        Ok(())\n    }\n\n    async fn upgrade(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        if let Some(p) = pkgs.iter().find(|p| !is_adam_id(&p.name)) {\n            bail!(\"mas upgrade requires a numeric ADAM ID ('{p}'); use `mas search` to find it\");\n        }\n        let mut args = vec![\"upgrade\".to_string()];\n        args.extend(pkgs.iter().map(|p| p.name.clone()));\n        if opts.dry_run {\n            miseprintln!(\"mas {}\", args.join(\" \"));\n            return Ok(());\n        }\n        debug!(\"$ mas {}\", args.join(\" \"));\n        let output = tokio::process::Command::new(self.bin().await?)\n            .args(&args)\n            .stdin(Stdio::null())","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/mas.rs#L258-L294","documentation":"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).","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Read the stderr in the error message for mas's own explanation","Verify sign-in with `mas account` and that the Apple ID owns/has accepted the app","Confirm the ADAM ID is correct via `mas search`","Retry later if App Store services are down"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"mas account >/dev/null 2>&1 && mas list >/dev/null 2>&1 && echo \"mas ready\"","typeGuard":null,"tryCatchPattern":"if let Err(e) = provider.install(&pkgs, &opts).await {\n    if e.to_string().contains(\"mas install failed\") {\n        eprintln!(\"check Apple ID ownership/region for {ids:?}: {e}\");\n    }\n}","preventionTips":["Confirm the Apple ID owns each app before automating installs","Watch Apple System Status for App Store outages","Ensure each app supports the current macOS version"],"tags":["macos","mas","subprocess","package-manager"],"backgroundTag":"command-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}