{"record":{"id":"969ee576e9cf4a66","repo":"BoundaryML/baml","slug":"http-status-fetching-url","errorCode":null,"errorMessage":"HTTP {status} fetching {url}","messagePattern":"HTTP (.+?) fetching (.+?)","errorType":"exception","errorClass":"FetchError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_release/src/lib.rs","lineNumber":80,"sourceCode":"pub enum Product {\n    Toolchain,\n    Wrapper,\n}\n\nimpl Product {\n    pub fn tag_prefix(self) -> &'static str {\n        match self {\n            Product::Toolchain => \"baml-language\",\n            Product::Wrapper => \"baml-wrapper\",\n        }\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum FetchError {\n    #[error(\"network error fetching {url}: {source}\")]\n    Network { url: String, source: reqwest::Error },\n    #[error(\"HTTP {status} fetching {url}\")]\n    HttpStatus {\n        url: String,\n        status: reqwest::StatusCode,\n    },\n    #[error(\"manifest 404 for version {version} (not released yet?)\")]\n    ManifestNotFound { version: String },\n    #[error(\"manifest schema {got} not supported (max {max}); run `baml self-update`\")]\n    ManifestSchemaTooNew { got: u32, max: u32 },\n    #[error(\"target {target} not built for version {version}\")]\n    TargetNotInManifest { target: String, version: String },\n    #[error(\"sha256 mismatch for {url}: expected {expected}, got {got}\")]\n    ChecksumMismatch {\n        url: String,\n        expected: String,\n        got: String,\n    },\n    #[error(\"archive missing expected binary {name}\")]\n    BinaryNotInArchive { name: String },","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_release/src/lib.rs#L62-L98","documentation":"FetchError::HttpStatus is thrown by baml_release when the release server responds with an HTTP error status code (anything non-successful that isn't a manifest 404, which has its own variant). The variant carries the URL and the reqwest::StatusCode so the developer can identify the failing endpoint and the specific status.","triggerScenarios":"Any baml_release fetch/self-update API call that receives an error HTTP response (e.g. 500 from the release server, 403 from a CDN/WAF, 502/503 from a load balancer) instead of the expected manifest or archive bytes.","commonSituations":"Release CDN misconfiguration, a proxy/firewall intercepting the request and returning 403, the release server returning 5xx during deploys, or rate limiting returning 429.","solutions":["Check the status code and URL in the error to identify the failing endpoint","Retry if the status is 5xx — often transient during server deploys","If 403/429, check proxy/WAF rules or rate limits between you and the release host","Verify the release exists on the release server by fetching the URL manually","Retry with an older/newer version argument if the endpoint for that version is broken"],"exampleFix":"// before (naive retry ignores status)\nmatch fetch(url) { ... }\n// after\nmatch fetch(url) {\n    Err(FetchError::HttpStatus { status, .. }) if status.is_server_error() =>\n        retry_with_backoff(url),\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","handlingStrategy":"try-catch","validationCode":"// pre-check the endpoint before a full update flow\nlet status = reqwest::blocking::Client::new()\n    .head(manifest_url).send().map(|r| r.status());","typeGuard":"fn is_http_status_err(e: &FetchError) -> Option<reqwest::StatusCode> {\n    if let FetchError::HttpStatus { status, .. } = e { Some(*status) } else { None }\n}","tryCatchPattern":"match fetch(url) {\n    Err(FetchError::HttpStatus { status, .. }) if status.as_u16() == 429 =>\n        wait_and_retry(rate_limit_delay),\n    Err(FetchError::HttpStatus { status, .. }) if status.is_server_error() =>\n        retry_with_backoff(2)?,\n    Err(FetchError::HttpStatus { url, status }) =>\n        bail!(\"release endpoint {url} returned {status}\"),\n    other => other,\n}","preventionTips":["Retry idempotent GETs on 5xx with backoff","Honor Retry-After on 429 responses","Check proxy/WAF configurations when seeing 403s","Pin to a mirror or cached manifest URL if the primary endpoint is flaky"],"tags":["http","network","rust"],"backgroundTag":"http-error-response","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"}