jdx/mise · error

Unsupported forge type

Error message

Unsupported forge type {:?}

What it means

The ubi backend only supports GitHub and GitLab forges when deriving the API URL. If api_url_override is unset and the forge type is anything else, api_url bails with 'Unsupported forge type'. ubi is deprecated in mise and only these two forges are wired up.

Solutions

  1. Set an explicit api_url override in the tool config if the forge exposes a compatible API
  2. Switch the tool entry to a github:/ or gitlab:/ backend instead of ubi
  3. Check that the platform/forge configuration for the ubi tool is one of GitHub or GitLab

Example fix

# before (ubi tool config with unsupported forge)
[tools]
mytool = { source = "ubi", forge = "forgejo" }
# after
[tools]
mytool = "github:owner/mytool"
Defensive patterns

Strategy: fallback

Validate before calling

# pre-check forge support
SUPPORTED = {'github', 'gitlab'}
assert forge in SUPPORTED or config.get('api_url'), 'ubi: set api_url or use a supported forge'

Type guard

fn forge_is_github_or_gitlab(f: &ForgeType) -> bool {
    matches!(f, ForgeType::GitHub | ForgeType::GitLab)
}

Try / catch

match api_url_result {
    Err(e) if e.to_string().contains("Unsupported forge type") =>
        switch_to_github_or_gitlab_backend(),
    r => r,
}

Prevention

When it happens

Trigger: Resolving the API URL for a ubi-based tool whose configuration (or ubi defaults) yields a ForgeType other than GitHub or GitLab, with no api_url override set.

Common situations: Misconfigured ubi tool entries pointing at unsupported forges (e.g. Forgejo, SourceHut); internal registry assumptions that ubi cannot serve.

Related errors


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

Appendix: 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 533346cc37)