jdx/mise · error · eyre::Report

Unsupported forge type {:?}

Error message

Unsupported forge type {:?}

What it means

The ubi backend maps its `provider` option to the ubi crate's ForgeType. When computing the default API URL, only ForgeType::GitHub and ForgeType::GitLab have a known API endpoint; any other variant (e.g. `generic`) without an explicit `api_url` override makes api_url() bail with 'Unsupported forge type' (src/backend/ubi.rs:63).

Source

Thrown at src/backend/ubi.rs:63

    fn provider(&self) -> eyre::Result<ForgeType> {
        match self.values.str("provider") {
            Some(forge) => Ok(ForgeType::from_str(forge)?),
            None => Ok(ForgeType::default()),
        }
    }

    fn api_url_override(&self) -> Option<&'a str> {
        self.values.str("api_url")
    }

    fn api_url(&self, forge: &ForgeType) -> eyre::Result<String> {
        match self.api_url_override() {
            Some(api_url) => Ok(api_url.strip_suffix('/').unwrap_or(api_url).to_string()),
            None => match forge {
                ForgeType::GitHub => Ok(github::API_URL.to_string()),
                ForgeType::GitLab => Ok(gitlab::API_URL.to_string()),
                _ => bail!("Unsupported forge type {:?}", forge),
            },
        }
    }

    fn tag_regex(&self) -> Option<&'a str> {
        self.values.str("tag_regex")
    }

    fn bin_path(&self) -> Option<String> {
        self.values.platform_string("bin_path")
    }

    fn extract_all(&self) -> bool {
        self.values.bool("extract_all")
    }

    fn exe(&self) -> Option<&'a str> {
        self.values.str("exe")

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Set provider = "github" (the default) or provider = "gitlab" — these are the only forges with built-in API support here
  2. If you are on an enterprise/self-hosted GitHub or GitLab, keep the provider and add api_url = "https://gitlab.example.com/api/v4" (or /api/v3) instead of switching provider
  3. For non-GitHub/GitLab forges, use the http backend with an explicit url, or aqua/github backends

Example fix

# before (mise.toml)
[tools.ubi]
mytool = { repo = 'example/mytool', provider = 'generic' }

# after
[tools.ubi]
mytool = { repo = 'example/mytool', provider = 'github' }
Defensive patterns

Strategy: validation

Validate before calling

# Validate the provider option before install
fn supported_provider(p: Option<&str>) -> bool {
    matches!(p, None | Some("github") | Some("gitlab"))
}
assert!(supported_provider(None));
assert!(!supported_provider(Some("generic")));

Prevention

When it happens

Trigger: Setting `provider = "generic"` (or any non-github/gitlab ForgeType accepted by ForgeType::from_str) in a mise.toml ubi tool entry without also setting `api_url`. Triggers on the first operation that needs the API URL: install, ls-remote, or version listing.

Common situations: Trying to install from a forge other than GitHub/GitLab via ubi; copying an ubi CLI `--forge` value that mise's version-listing code does not support; setting provider to a string that parses to the generic variant.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/5048c2c53b96390a. Report an issue: GitHub.