{"record":{"id":"53a5532978d57c75","repo":"BoundaryML/baml","slug":"failed-to-download-asset-e","errorCode":null,"errorMessage":"Failed to download asset: {e}","messagePattern":"Failed to download asset: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/playground-server/src/server.rs","lineNumber":224,"sourceCode":"                extract_root.display()\n            )\n        })?;\n    }\n    std::fs::create_dir_all(&extract_root).with_context(|| {\n        format!(\n            \"Failed to create extraction directory: {}\",\n            extract_root.display()\n        )\n    })?;\n\n    // Download the tar.gz asset\n    tracing::info!(\"Downloading web-panel asset from: {}\", download_url);\n    let resp = client\n        .get(download_url)\n        .header(\"User-Agent\", \"baml-playground-server\")\n        .send()\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to download asset: {e}\"))?;\n    let bytes = resp.bytes().await?;\n\n    // Verify SHA256 checksum\n    verify_sha256_checksum(&bytes, checksum_url, &client).await?;\n\n    // Extract the verified archive\n    let tar = GzDecoder::new(Cursor::new(bytes));\n    let mut archive = Archive::new(tar);\n    archive\n        .unpack(&extract_root)\n        .with_context(|| format!(\"Failed to extract archive to: {}\", extract_root.display()))?;\n\n    // Return the path to the actual dist directory if it exists, else the extraction root\n    if dist_dir.exists() && dist_dir.read_dir()?.next().is_some() {\n        Ok(dist_dir.to_string_lossy().to_string())\n    } else {\n        Ok(extract_root.to_string_lossy().to_string())\n    }","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/playground-server/src/server.rs#L206-L242","documentation":"get_playground_dist downloads the web-panel asset archive over HTTPS via reqwest; when the request itself fails (connection, DNS, TLS, timeout), it wraps the reqwest error into \"Failed to download asset: {e}\". This happens before checksum verification and extraction.","triggerScenarios":"client.get(download_url).send().await returns Err — network unreachable, DNS failure, TLS error, request timeout, or invalid URL scheme when fetching the playground dist asset.","commonSituations":"Offline or air-gapped environments trying to fetch the playground on demand; corporate proxies blocking the download URL; GitHub release asset URL changed/renamed; DNS misconfiguration in containers.","solutions":["Check network connectivity and proxy settings (HTTPS_PROXY / HTTP_PROXY env vars) on the host.","Confirm the download_url printed in the log ('Downloading web-panel asset from: ...') is reachable with curl and returns 200.","Retry with a longer reqwest timeout if the failure is a timeout, or pre-place the extracted dist under ~/.baml/playground so download is skipped."],"exampleFix":"// before\nlet client = reqwest::Client::new();\n// after: add proxy support and timeout\nlet client = reqwest::Client::builder()\n    .timeout(std::time::Duration::from_secs(60))\n    .build()?;","handlingStrategy":"retry","validationCode":"curl -fsSI \"$ASSET_URL\" >/dev/null && echo reachable || echo unreachable","typeGuard":null,"tryCatchPattern":"match get_playground_dist().await {\n    Err(e) if e.to_string().starts_with(\"Failed to download asset\") => retry_with_backoff(3),\n    other => other?,\n}","preventionTips":["Configure proxy env vars in restricted networks.","Pre-populate ~/.baml/playground cache for air-gapped hosts.","Set generous reqwest timeouts."],"tags":["network","rust","download","http"],"backgroundTag":"network-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"}