SeleniumHQ/selenium · error · anyhow::Error
Unable to discover proper {} version in offline mode
Error message
Unable to discover proper {} version in offline mode What it means
Produced by assert_online_or_err() using the OFFLINE_REQUEST_ERR_MSG constant ("Unable to discover proper {} version in offline mode"). It fires when Selenium Manager has detected offline mode but a manager's request_driver_version() needs the network (IEDriver, Edge, Firefox, Chrome, Grid, Electron). The placeholder is the driver name.
Source
Thrown at rust/src/lib.rs:1171
let mut release_version = driver_version.to_string();
if !driver_version.ends_with('0') && !self.is_nightly(driver_version) {
// E.g.: version 4.8.1 is shipped within release 4.8.0
let error_message = format!(
"Wrong {} version: '{}'",
self.get_driver_name(),
driver_version
);
let index = release_version.rfind('.').ok_or(anyhow!(error_message))? + 1;
release_version = release_version[..index].to_string();
release_version.push('0');
}
Ok(format!("selenium-{release_version}"))
}
fn assert_online_or_err(&self, message: &str) -> Result<(), Error> {
if self.is_offline() {
return Err(anyhow!(format_one_arg(message, self.get_driver_name())));
}
Ok(())
}
fn get_driver_name_with_extension(&self) -> String {
format!(
"{}{}",
self.get_driver_name(),
get_binary_extension(self.get_os())
)
}
fn get_browser_name_with_extension(&self) -> String {
format!(
"{}{}",
self.get_browser_name(),
get_binary_extension(self.get_os())
)View on GitHub (pinned to aa36b38e69)
Solutions
- Allow network egress to the version-discovery endpoints (googlechromelabs.github.io, github.com, *githubusercontent.com, edge updates URLs).
- Pre-populate the Selenium Manager cache with the needed driver so discovery can be served locally.
- Pin the driver version via --driver-version so online discovery is bypassed.
- Remove an explicit --offline flag if the host actually has connectivity.
Example fix
# before selenium-manager --browser edge --offline # cannot discover # after (allow network, or pin) selenium-manager --browser edge curl -fsSL https://msedgedriver.azureedge.net/<ver>/edgedriver_<os>.zip -o ~/.cache/selenium/...
Defensive patterns
Strategy: validation
Validate before calling
use std::net::ToSocketAddrs;
fn has_network() -> bool {
"googlechromelabs.github.io:443".to_socket_addrs().is_ok()
}
// guard before relying on online discovery
if !has_network() {
eprintln!("offline: pin a driver version or seed the cache");
} Prevention
- Pre-seed the Selenium Manager cache on a connected machine.
- Pin driver versions for air-gapped environments.
- Verify DNS/egress to the version endpoints in CI.
When it happens
Trigger: is_offline() is true and a browser manager calls self.assert_online_or_err(OFFLINE_REQUEST_ERR_MSG) inside request_driver_version() (see iexplorer.rs:140, edge.rs:245, firefox.rs:241, chrome.rs:345, grid.rs:128, electron.rs:184).
Common situations: Air-gapped CI; --offline flag set; no default route detected; DNS resolution failing so Selenium Manager treats the host as offline; corporate firewall blocks the version endpoints.
Related errors
- The {} version cannot be discovered
- Unable to download {} in offline mode
- Unable to obtain browser driver. For more informatio
- Error executing command for ${smBinary} with ${args}: ${erro
- Unsuccessful command executed: {command}; code: {completed_p
AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14).
Data as JSON: /api/errors/86c6bfae434e9501.
Report an issue: GitHub.