{"record":{"id":"ba6725118ff7d05d","repo":"SeleniumHQ/selenium","slug":"unsuccessful-response-for-url","errorCode":null,"errorMessage":"Unsuccessful response ({}) for URL {}","messagePattern":"Unsuccessful response \\((.+?)\\) for URL (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/downloads.rs","lineNumber":45,"sourceCode":"use tempfile::{Builder, TempDir};\n\n#[tokio::main]\npub async fn download_to_tmp_folder(\n    http_client: &Client,\n    url: String,\n    log: &Logger,\n) -> Result<(TempDir, String), Error> {\n    let tmp_dir = Builder::new().prefix(\"selenium-manager\").tempdir()?;\n    log.trace(format!(\n        \"Downloading {} to temporal folder {:?}\",\n        url,\n        tmp_dir.path()\n    ));\n\n    let response = http_client.get(&url).send().await?;\n    let status_code = response.status();\n    if status_code != StatusCode::OK {\n        return Err(anyhow!(format!(\n            \"Unsuccessful response ({}) for URL {}\",\n            status_code, url\n        )));\n    }\n\n    let target_path;\n    let mut tmp_file = {\n        let target_name = response\n            .url()\n            .path_segments()\n            .and_then(|mut segments| segments.next_back())\n            .and_then(|name| if name.is_empty() { None } else { Some(name) })\n            .unwrap_or(\"tmp.bin\");\n\n        log.trace(format!(\"File to be downloaded: {}\", target_name));\n        let target_name = tmp_dir.path().join(target_name);\n        target_path = String::from(target_name.to_str().unwrap());\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/downloads.rs#L27-L63","documentation":"Raised by download_to_tmp_folder() in rust/src/downloads.rs when an HTTP GET to the supplied URL completes but the response status is not 200 OK. Selenium Manager treats any non-OK status as a download failure, including 3xx (because reqwest follows redirects by default) and 4xx/5xx. The URL and status code are included for diagnosis.","triggerScenarios":"http_client.get(&url).send().await returns a response with status_code != StatusCode::OK. Common: 404 for a yanked driver version, 403 from a rate-limited/region-blocked CDN, 5xx during an upstream outage, or a stale mirror.","commonSituations":"A driver version was unpublished (404); the mirror endpoint changed; transient Google/Microsoft CDN outage; corporate proxy returns 407/502; DNS resolves but TLS/CDN returns an error page.","solutions":["Check the URL in a browser/curl to see the exact status and confirm the resource exists.","Retry after a short delay for transient 5xx errors.","If using a mirror, verify the mirror URL env/config still resolves the driver.","Pin a known-available driver version instead of the bleeding edge.","Inspect proxy/VPN settings if you see 403/407."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Rust: pre-check reachability / status before delegating to download_to_tmp_folder\nlet resp = http_client.head(&url).send().await?;\nif !resp.status().is_success() {\n    return Err(anyhow!(\"Pre-check failed with {} for {}\", resp.status(), url));\n}","typeGuard":null,"tryCatchPattern":"for attempt in 0..3 {\n    match download_to_tmp_folder(&client, url.clone(), &log).await {\n        Ok(result) => return Ok(result),\n        Err(e) if e.to_string().contains(\"Unsuccessful response\") && attempt < 2 => {\n            tokio::time::sleep(std::time::Duration::from_secs(2u64.pow(attempt))).await;\n            continue;\n        }\n        Err(e) => return Err(e),\n    }\n}","preventionTips":["Verify driver URLs are still valid before pinning versions.","Use mirror endpoints with high availability for CI.","Implement retry with exponential backoff for transient 5xx.","Check proxy configuration when 403/407 appears."],"tags":["rust","selenium-manager","network","http","download"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}