jdx/mise · error

mas upgrade requires a numeric ADAM ID ('{p}'); use `mas sea

Error message

mas upgrade requires a numeric ADAM ID ('{p}'); use `mas search` to find it

What it means

Request validation in the mas manager's upgrade(): a requested package name is not a numeric ADAM ID, which mas requires for upgrades (unlike searching by name). The error directs users to `mas search` to find the numeric ID.

Source

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

            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())
            .output()
            .await?;
        if !output.status.success() {
            let stderr = String::from_utf8_lossy(&output.stderr);
            bail!("mas upgrade failed: {}", stderr.trim());
        }
        Ok(())

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Run `mas search <name>` to find the numeric ADAM ID
  2. Replace the app name with its numeric ID in the mise package config
  3. Re-run the upgrade with only numeric IDs

Example fix

// before
upgrade(&[PackageRequest { name: "Keynote".into(), .. }])
// after
upgrade(&[PackageRequest { name: "409183694".into(), .. }])
Defensive patterns

Strategy: validation

Validate before calling

pkgs.iter().all(|p| p.name.chars().all(|c| c.is_ascii_digit()))

Try / catch

if let Err(e) = provider.upgrade(&pkgs, &opts).await {
    if e.to_string().contains("numeric ADAM ID") {
        eprintln!("map names to ADAM IDs via `mas search` before upgrading");
    }
}

Prevention

When it happens

Trigger: Calling mas upgrade with a request whose name fails is_adam_id — human-readable app names, cask-style names, or malformed identifiers.

Common situations: Upgrade lists generated from human-readable config; mixed provider configs where names came from Homebrew; copy/paste of app titles instead of IDs.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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