{"record":{"id":"4409143ea40045ce","repo":"BoundaryML/baml","slug":"err-pack-command","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/pack_command.rs","lineNumber":611,"sourceCode":"    if target_triple.ends_with(\"windows-msvc\") {\n        \"baml-pack-host.exe\".to_string()\n    } else {\n        \"baml-pack-host\".to_string()\n    }\n}\n\nfn download_host_binary_from_release(target: &str, host_name: &str) -> Result<Vec<u8>> {\n    let version = release_version_for_download();\n    let fetcher = baml_release::Fetcher::default_for(\n        baml_release::ReleaseSpec {\n            version,\n            target: target.to_string(),\n        },\n        baml_release::Product::Toolchain,\n    );\n    fetcher\n        .fetch_binary(host_name)\n        .map_err(|err| anyhow!(\"{err}\"))\n}\n\nfn release_version_for_download() -> String {\n    std::env::var(\"BAML_PACK_HOST_RELEASE_VERSION\")\n        .ok()\n        .filter(|v| !v.trim().is_empty())\n        .unwrap_or_else(|| release_version().to_string())\n}\n\nfn release_host_target_triple() -> Result<&'static str> {\n    baml_release::release_host_target_triple()\n}\n\nfn validate_release_target_triple(target: &str) -> Result<&str> {\n    baml_release::validate_release_target_triple(target)\n        .map_err(|err| anyhow!(\"unsupported pack target `{target}`. {err}\"))\n}\n","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/pack_command.rs#L593-L629","documentation":"`download_host_binary_from_release` wraps any failure from `fetcher.fetch_binary(host_name)` (a release-asset download for the host binary) into a plain `anyhow!` error that simply interpolates the underlying message. It means the pack command could not download the platform-specific host binary from the BAML release artifacts.","triggerScenarios":"`read_host_binary` fails to find a local host binary next to the executable (non-native target or missing file), so it calls `download_host_binary_from_release`, whose `fetcher.fetch_binary(host_name)` returns an Err — network failure, missing release asset for that target/version, or auth/HTTP error — which is rewrapped verbatim with `anyhow!(\"{err}\")`.","commonSituations":"Offline or proxied environment blocking GitHub releases; `BAML_PACK_HOST_RELEASE_VERSION` pinned to a version whose assets don't exist; a target triple with no published host binary; corporate proxy or firewall blocking the download.","solutions":["Check network connectivity / proxy settings so the release download can reach the release host.","Verify the release version being downloaded exists and has an asset for your target; unset or correct `BAML_PACK_HOST_RELEASE_VERSION` if it pins a nonexistent release.","Confirm the target triple passed to `baml pack` is one with published host binaries (`baml pack` with a supported triple).","Place the correct host binary next to the `baml` executable manually so the download path is skipped entirely."],"exampleFix":"// before: pinned to a version with no matching asset\nexport BAML_PACK_HOST_RELEASE_VERSION=0.0.0\n// after: let the tool use the current release, or pin a real one\nunset BAML_PACK_HOST_RELEASE_VERSION\n# or\nexport BAML_PACK_HOST_RELEASE_VERSION=0.205.0","handlingStrategy":"retry","validationCode":"// before packing, check the pinned release exists\nlet version = std::env::var(\"BAML_PACK_HOST_RELEASE_VERSION\").ok();\nif let Some(v) = version {\n    let url = format!(\"https://github.com/{repo}/releases/tag/{v}\");\n    if reqwest::blocking::get(&url)?.status() != 200 {\n        return Err(anyhow!(\"release {v} does not exist; unset BAML_PACK_HOST_RELEASE_VERSION or pick a published version\"));\n    }\n}","typeGuard":null,"tryCatchPattern":"match download_host_binary_from_release(&target, &reporter) {\n    Ok(bytes) => install(bytes),\n    Err(e) => {\n        warn!(\"host binary download failed: {e}; retrying with backoff\");\n        with_backoff(3, || download_host_binary_from_release(&target, &reporter))?;\n    }\n}","preventionTips":["Don't pin `BAML_PACK_HOST_RELEASE_VERSION` to unverified version strings.","Ensure the environment (proxy/firewall) can reach the release host before running pack.","Pre-bundle the host binary next to the CLI executable so no download is needed.","Verify your target triple has published release assets for the chosen version."],"tags":["rust","cli","network","download","release-assets"],"backgroundTag":"http-request-failed","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}