{"record":{"id":"0b9adb9089c7f53a","repo":"SeleniumHQ/selenium","slug":"unable-to-download-in-offline-mode","errorCode":null,"errorMessage":"Unable to download {} in offline mode","messagePattern":"Unable to download (.+?) in offline mode","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/lib.rs","lineNumber":1171,"sourceCode":"\n        let mut release_version = driver_version.to_string();\n        if !driver_version.ends_with('0') && !self.is_nightly(driver_version) {\n            // E.g.: version 4.8.1 is shipped within release 4.8.0\n            let error_message = format!(\n                \"Wrong {} version: '{}'\",\n                self.get_driver_name(),\n                driver_version\n            );\n            let index = release_version.rfind('.').ok_or(anyhow!(error_message))? + 1;\n            release_version = release_version[..index].to_string();\n            release_version.push('0');\n        }\n        Ok(format!(\"selenium-{release_version}\"))\n    }\n\n    fn assert_online_or_err(&self, message: &str) -> Result<(), Error> {\n        if self.is_offline() {\n            return Err(anyhow!(format_one_arg(message, self.get_driver_name())));\n        }\n        Ok(())\n    }\n\n    fn get_driver_name_with_extension(&self) -> String {\n        format!(\n            \"{}{}\",\n            self.get_driver_name(),\n            get_binary_extension(self.get_os())\n        )\n    }\n\n    fn get_browser_name_with_extension(&self) -> String {\n        format!(\n            \"{}{}\",\n            self.get_browser_name(),\n            get_binary_extension(self.get_os())\n        )","sourceCodeStart":1153,"sourceCodeEnd":1189,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/lib.rs#L1153-L1189","documentation":"Produced by assert_online_or_err() using the OFFLINE_DOWNLOAD_ERR_MSG constant (\"Unable to download {} in offline mode\"). It fires from the download step (lib.rs:985) when Selenium Manager is offline but a driver binary must be fetched. The placeholder is the driver name.","triggerScenarios":"is_offline() is true and the flow reaches the driver-download step (assert_online_or_err(OFFLINE_DOWNLOAD_ERR_MSG) at lib.rs:985), i.e. the driver is not in cache and must be downloaded.","commonSituations":"Offline host with a cache miss; first run on an air-gapped machine; cache was cleared (selenium-manager --clear-cache) while offline.","solutions":["Restore connectivity for the initial download, then run offline subsequently (the cached driver will be reused).","Manually place the driver in the Selenium cache directory before running.","Pin the driver version and pre-seed the cache from another machine."],"exampleFix":"# before\nselenium-manager --browser chrome --offline   # cache miss -> error\n# after (seed cache once online, then run offline)\nselenium-manager --browser chrome            # populates cache\nselenium-manager --browser chrome --offline  # now uses cache","handlingStrategy":"validation","validationCode":"// Verify the driver is already cached before running offline\nuse std::path::PathBuf;\nfn driver_cached(driver_name: &str, cache: &PathBuf) -> bool {\n    cache.read_dir().map(|entries| entries\n        .filter_map(Result::ok)\n        .any(|e| e.file_name().to_string_lossy().contains(driver_name)))\n        .unwrap_or(false)\n}\nif offline && !driver_cached(\"chromedriver\", &cache_path) {\n    return Err(anyhow!(\"seed cache before going offline\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run Selenium Manager once online to populate the cache before operating offline.","Keep a backup of the cache directory for restore on air-gapped hosts.","Pin driver versions so the exact cached artifact is deterministic."],"tags":["offline","download","network","selenium-manager"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}