jdx/mise · error
mas upgrade failed: {}
Error message
mas upgrade failed: {} What it means
Process failure in the mas manager's upgrade(): `mas upgrade <ids...>` exited non-zero and its trimmed stderr is surfaced. Fires when the App Store session is stale, an app cannot update, or the mas CLI fails.
Source
Thrown at src/system/packages/mas.rs:299
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())
.output()
.await?;
if !output.status.success() {
let stderr = String::from_utf8_lossy(&output.stderr);
bail!("mas upgrade failed: {}", stderr.trim());
}
Ok(())
}
}
pub(crate) fn is_adam_id(name: &str) -> bool {
!name.is_empty() && name.chars().all(|c| c.is_ascii_digit())
}
#[cfg(test)]
mod tests {
use super::*;
fn req(name: &str, version: Option<&str>) -> PackageRequest {
PackageRequest {
name: name.to_string(),
version: version.map(str::to_string),
tap_url: None,View on GitHub (pinned to afd2eddd3a)
Solutions
- Read the stderr embedded in the error for mas's specific complaint
- Re-authenticate (`mas account` / App Store sign-in) and retry
- Free disk space and ensure macOS meets each app's requirements
- Run `mas upgrade` manually to reproduce outside mise
Defensive patterns
Strategy: retry
Validate before calling
mas list >/dev/null 2>&1 || echo "App Store session broken; re-sign in"
Try / catch
for attempt in 0..3 {
match provider.upgrade(&pkgs, &opts).await {
Err(e) if e.to_string().contains("mas upgrade failed") && attempt < 2 => {
tokio::time::sleep(Duration::from_secs(30)).await;
}
other => { other?; break; }
}
} Prevention
- Re-authenticate before long automation runs
- Ensure adequate disk space for app updates
- Keep macOS versions within each app's supported range
When it happens
Trigger: `mas upgrade` exits non-zero — not signed in, app updates fail to download/install, App Store daemon errors, or an app requires a newer macOS than installed.
Common situations: Pending updates needing a macOS upgrade; App Store authentication expired; disk space exhaustion during download; Apple service interruptions.
Related errors
- mas list failed: {}
- mas install failed: {}
- mas app IDs must be numeric ADAM IDs (e.g. "mas:497799835")
- mas list --json returned an app object without an ID and ver
- mas install requires a numeric ADAM ID ('{p}'); use `mas sea
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/d3a3f8de45c81006.
Report an issue: GitHub.