{"record":{"id":"6c3394e7c4c9a3ae","repo":"jdx/mise","slug":"unsupported-archive-format","errorCode":null,"errorMessage":"unsupported archive format","messagePattern":"unsupported archive format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/github_relay.rs","lineNumber":254,"sourceCode":"        }\n    }\n    let host = if p[0] == \"api\" {\n        \"api.github.com\"\n    } else {\n        \"github.com\"\n    };\n    let suffix = path.split_once('/').expect(\"validated path\").1;\n    let mut url = format!(\"https://{host}/{suffix}\");\n    let archive_repo = match p.as_slice() {\n        [\"api\", \"repos\", _, _, \"tarball\" | \"zipball\", ..] => Some(name.clone()),\n        [\"web\", _, _, \"archive\", rest @ ..] => {\n            let reference = rest.join(\"/\");\n            let (kind, reference) = if let Some(reference) = reference.strip_suffix(\".tar.gz\") {\n                (\"tarball\", reference)\n            } else if let Some(reference) = reference.strip_suffix(\".zip\") {\n                (\"zipball\", reference)\n            } else {\n                bail!(\"unsupported archive format\");\n            };\n            if reference.is_empty() {\n                bail!(\"missing archive reference\");\n            }\n            // The API supplies short-lived private archive links; credentials\n            // remain at the API origin and are never attached to that redirect.\n            url = format!(\"https://api.github.com/repos/{name}/{kind}/{reference}\");\n            Some(name)\n        }\n        _ => None,\n    };\n    if let Some(query) = query {\n        url.push('?');\n        url.push_str(query);\n    }\n    Ok(Target {\n        url,\n        git,","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/github_relay.rs#L236-L272","documentation":"When authorizing a web archive download (`/web/{owner}/{repo}/archive/{ref}.<ext>`), `authorize` recognizes only `.tar.gz` (tarball) and `.zip` (zipball) suffixes. Any other extension — or none — fails with this error, and the stripped suffix must leave a non-empty reference.","triggerScenarios":"Requesting an archive URL whose reference ends in something other than `.tar.gz` or `.zip`, e.g. `/web/o/r/archive/main.tar.bz2`, `/web/o/r/archive/v1.tar`, `/web/o/r/archive/v1`, or `/web/o/r/archive/.zip` (empty ref after stripping).","commonSituations":"Copy codeload URLs in other formats (`tar.bz2`, `zip.gz`); tooling that defaults to a different compression; building the URL manually and forgetting the extension entirely; a bare ref where the suffix got truncated by string handling.","solutions":["Use `.tar.gz` for the tarball or `.zip` for the zipball suffix: `/web/{owner}/{repo}/archive/{ref}.tar.gz`.","Ensure the ref remains non-empty after the suffix is stripped (don't pass just `archive/.zip`).","If you need another format, convert locally after downloading the supported `.tar.gz`/`.zip` artifact."],"exampleFix":"// before\nlet path = \"/web/octocat/hello-world/archive/main.tar.bz2\";\n// after\nlet path = \"/web/octocat/hello-world/archive/main.tar.gz\";","handlingStrategy":"validation","validationCode":"fn archive_suffix_ok(reference: &str) -> bool {\n    let stripped = reference\n        .strip_suffix(\".tar.gz\")\n        .or_else(|| reference.strip_suffix(\".zip\"));\n    stripped.map(|s| !s.is_empty()).unwrap_or(false)\n}\nassert!(archive_suffix_ok(\"v1.2.0.tar.gz\"));","typeGuard":null,"tryCatchPattern":"match relay::operation(\"GET\", path, None) {\n    Err(e) if e.to_string().contains(\"archive format\") => eprintln!(\"use .tar.gz or .zip suffix: {path}\"),\n    Err(e) => return Err(e),\n    Ok(t) => t,\n}","preventionTips":["Always append `.tar.gz` or `.zip` when constructing codeload/archive URLs.","Verify the ref is non-empty after stripping the suffix before requesting.","Convert alternative formats locally after downloading a supported archive."],"tags":["github","relay","archive","format"],"backgroundTag":"invalid-argument-format","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"}