{"record":{"id":"cfcfd5f8920ee64b","repo":"BoundaryML/baml","slug":"err","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml/src/main.rs","lineNumber":1244,"sourceCode":"    fs::create_dir_all(toolchains_dir())?;\n    if force {\n        let dir = toolchains_dir().join(version);\n        if dir.exists() {\n            fs::remove_dir_all(dir)?;\n        }\n    }\n    let fetcher = baml_release::Fetcher::from_artifact(\n        ReleaseSpec {\n            version: version.to_string(),\n            target: target.to_string(),\n        },\n        Product::Toolchain,\n        artifact,\n    );\n    fetcher\n        .install_to_toolchain_root(&toolchains_dir())\n        .map(|_| ())\n        .map_err(|err| anyhow!(\"{err}\"))\n}\n\nfn prepare_toolchain_selector(\n    selector: &str,\n    base: &Path,\n    override_url: Option<&str>,\n) -> Result<String> {\n    let selector = normalize_selector(selector, base);\n    if is_path_selector(&selector) {\n        verify_path_toolchain(Path::new(&selector), \"\")?;\n        return Ok(selector);\n    }\n    if is_channel(&selector) {\n        install_toolchain(&selector, true, override_url, false)?;\n    } else {\n        let target = baml_release::release_host_target_triple()?;\n        if !toolchain_cli_path(&selector).exists() {\n            let manifest = fetch_manifest(&selector, override_url, FetchPolicy::CacheAllowed)?;","sourceCodeStart":1226,"sourceCodeEnd":1262,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml/src/main.rs#L1226-L1262","documentation":"install_toolchain downloads a toolchain artifact and installs it into the toolchains directory; if the fetcher's install_to_toolchain_root call fails, the underlying fetcher error is re-wrapped as-is via anyhow!. This is a generic propagation point — the real cause lives in the fetcher error message (download, network, or archive issues).","triggerScenarios":"Calling `baml toolchain install <version>` where fetcher.install_to_toolchain_root(&toolchains_dir()) returns Err — e.g. network failure, bad artifact URL, corrupt archive, or an unwritable toolchains directory.","commonSituations":"Offline or proxied environments blocking the download; disk full or permission issues in the toolchains dir; specifying an override_url that serves an invalid artifact.","solutions":["Read the wrapped {err} message for the root cause and fix accordingly (network, URL, disk).","Retry the install once connectivity is restored: `baml toolchain install <version>`.","Check the toolchains directory is writable, or use --override-url only with a known-good artifact URL."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// check network reachability first\ndns.promises.lookup('github.com').catch(() => console.warn('no network; install will fail'));","typeGuard":null,"tryCatchPattern":"try {\n  execFileSync('baml', ['toolchain', 'install', version]);\n} catch (e) {\n  console.error(`install failed: ${e.stderr ?? e.message}`); // {err} propagates the fetcher cause\n  process.exitCode = 1;\n}","preventionTips":["Ensure stable network / proxy config (HTTPS_PROXY) before installs.","Verify free disk space in the toolchains directory.","Use --override-url only with verified artifact URLs."],"tags":["network","install","toolchain"],"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-14T11:17:12.474Z"}