{"record":{"id":"94cbd1064da11190","repo":"jdx/mise","slug":"brew-cask-unsupported-tap-url-for-name-only-94cbd1","errorCode":null,"errorMessage":"brew-cask: unsupported tap URL for '{name}'; only GitHub tap URLs can be fetched directly","messagePattern":"brew-cask: unsupported tap URL for '(.+?)'; only GitHub tap URLs can be fetched directly","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/fetch.rs","lineNumber":34,"sourceCode":"            .and_then(super::super::api::github_raw_base)\n    {\n        let url = format!(\"{raw_base}/api/cask/{name}.json\");\n        match fetch_cask_url(name, &url, Some(normalize_cask_raw_base(raw_base)), false).await {\n            Ok(cask) => return Ok(cask),\n            Err(err) => debug!(\n                \"brew-cask: {name} unavailable in parent tap metadata ({err}); falling back to official metadata\"\n            ),\n        }\n    }\n    let (url, raw_base) = match tap_name {\n        Some((\"homebrew\", \"cask\", token)) => (\n            format!(\"{API_BASE}/cask/{token}.json\"),\n            Some(HOMEBREW_CASK_RAW.to_string()),\n        ),\n        Some((owner, tap, token)) => {\n            let Some(base) = super::super::api::tap_raw_base(owner, tap, req.tap_url.as_deref())\n            else {\n                bail!(\n                    \"brew-cask: unsupported tap URL for '{name}'; only GitHub tap URLs can be fetched directly\"\n                );\n            };\n            (\n                format!(\"{base}/api/cask/{token}.json\"),\n                Some(normalize_cask_raw_base(base)),\n            )\n        }\n        None => (\n            format!(\"{API_BASE}/cask/{name}.json\"),\n            Some(HOMEBREW_CASK_RAW.to_string()),\n        ),\n    };\n    match fetch_cask_url(requested_token, &url, raw_base.clone(), official_api).await {\n        Ok(cask) => Ok(cask),\n        Err(api_err) => {\n            let (owner, tap) = match tap_name {\n                Some((owner, tap, _)) if owner != \"homebrew\" || tap != \"cask\" => (owner, tap),","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/fetch.rs#L16-L52","documentation":"When a cask is requested from a tap, the fetcher builds a raw JSON API URL from the tap's owner/name. Only GitHub-hosted taps (github.com/owner/tap) can be fetched directly; `tap_raw_base` returns None for any other tap URL scheme, producing this error. The tool will not guess raw-file URLs for non-GitLab/GitHub forges.","triggerScenarios":"Installing or resolving a cask whose tap_url points at a non-GitHub tap (e.g. a GitLab-hosted tap, a plain HTTP tap URL, or a locally-registered forge), where tap_raw_base cannot derive a raw base.","commonSituations":"Users pointing mise's brew backend at self-hosted or alternative-forge taps, internal company taps on private Git servers, and taps migrated off GitHub.","solutions":["Host or mirror the tap on GitHub so its URL is github.com/<owner>/<tap>.","If a GitLab tap, verify the tap URL is in the recognized GitLab form supported by tap_raw_base; otherwise it's unsupported.","Bypass direct fetching: install the tap with real `brew tap` first so the cask can be read locally instead of via the raw API.","Rewrite MISE_BREW_TAP_URL (or equivalent setting) to a GitHub URL for the same tap."],"exampleFix":"// before\nbrew = { tap_url = \"https://git.example.com/team/homebrew-tap\" }\n// after\nbrew = { tap_url = \"https://github.com/team/homebrew-tap\" }","handlingStrategy":"fallback","validationCode":"function isGithubTap(url) {\n  try {\n    const u = new URL(url);\n    return u.hostname === \"github.com\" && /^\\/[^/]+\\/[^/]+/.test(u.pathname);\n  } catch { return false; }\n}\n// check before configuring tap_url","typeGuard":"function isGithubTapUrl(u: string | undefined): u is string {\n  return !!u && new URL(u).hostname === \"github.com\";\n}","tryCatchPattern":"try {\n  installCask(name);\n} catch (e) {\n  if (String(e).includes(\"unsupported tap URL\")) {\n    // fallback: shell out to `brew tap` + local install instead of direct fetch\n    execSync(`brew tap ${owner}/${tap}`);\n  } else throw e;\n}","preventionTips":["Host taps on GitHub for direct fetching","Use recognized gitlab.com URL forms if on GitLab","Pre-install non-GitHub taps with `brew tap` so local lookup works","Test tap URLs with a plain HTTPS fetch before configuring them"],"tags":["homebrew","cask","network","url","github"],"backgroundTag":"invalid-url","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"}