SeleniumHQ/selenium · error · anyhow::Error
Wrong browser/driver version
Error message
Wrong browser/driver version
What it means
Raised in uncompress() (files.rs:193) via the PARSE_ERROR constant when the downloaded file's detected extension is XML or HTML. This signals that the download endpoint did not return a binary archive but an error page (e.g. a 404 HTML page, an XML error envelope), usually because the requested driver version was wrong or unavailable. The message is the constant 'Wrong browser/driver version'.
Source
Thrown at rust/src/files.rs:193
target,
log,
)?
} else if extension.eq_ignore_ascii_case(PKG) {
uncompress_pkg(compressed_file, target, log)?
} else if extension.eq_ignore_ascii_case(DMG) {
uncompress_dmg(compressed_file, target, log, volume.unwrap_or_default())?
} else if extension.eq_ignore_ascii_case(EXE) {
uncompress_sfx(compressed_file, target, log)?
} else if extension.eq_ignore_ascii_case(DEB) {
uncompress_deb(compressed_file, target, log, volume.unwrap_or_default())?
} else if extension.eq_ignore_ascii_case(MSI) {
install_msi(compressed_file, log, os)?
} else if extension.eq_ignore_ascii_case(XML) || extension.eq_ignore_ascii_case(HTML) {
log.debug(format!(
"Wrong downloaded driver: {}",
fs::read_to_string(compressed_file).unwrap_or_default()
));
return Err(anyhow!(PARSE_ERROR));
} else {
return Err(anyhow!(format!(
"Downloaded file cannot be uncompressed ({} extension)",
extension
)));
}
Ok(())
}
pub fn uncompress_sfx(compressed_file: &str, target: &Path, log: &Logger) -> Result<(), Error> {
let zip_parent = Path::new(compressed_file).parent().unwrap();
log.trace(format!(
"Decompressing {} to {}",
compressed_file,
zip_parent.display()
));
View on GitHub (pinned to aa36b38e69)
Solutions
- Check Selenium Manager debug logs which print the HTML/XML body revealing the server's error.
- Verify the requested driver/browser version exists on the official endpoint.
- Re-run with auto version discovery (drop explicit --driver-version).
- Confirm the mirror URL is correct and returns binary archives.
Defensive patterns
Strategy: validation
Validate before calling
# Bash: detect HTML/XML error pages masquerading as driver archives TYPE=$(file -b --mime-type "$FILE") case "$TYPE" in text/html|application/xml|text/xml) echo "Download is an error page, not a driver"; exit 1;; esac
Try / catch
match uncompress(file, target, &log, os, single, vol) {
Ok(()) => (),
Err(e) if e.to_string().contains("Wrong browser/driver version") => {
eprintln!("Driver URL returned an error page; verify the version exists");
return Err(e);
}
Err(e) => return Err(e),
} Prevention
- Let Selenium Manager auto-discover driver versions instead of pinning wrong ones.
- Check Selenium Manager debug logs which print the HTML/XML body.
- Verify driver version availability on the official endpoint.
When it happens
Trigger: infer identifies the downloaded bytes as XML or HTML (line 188). The branch logs the file contents at debug level and returns Err(PARSE_ERROR). Typical when a driver version doesn't exist and the server returns an HTML 404 page saved as the driver archive.
Common situations: Requesting a chromedriver/edgedriver version that doesn't exist returns an HTML error page; a CDN serves an XML error envelope; version auto-detection picked a non-existent patch; mirror returns an error document with 200 status.
Related errors
- Unsuccessful response ({}) for URL {}
- Format for file {} cannot be inferred
- Downloaded file cannot be uncompressed ({} extension)
- {} {} not available for download on {} (minimum version: {})
- Error parsing JSON from URL {} {}
AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14).
Data as JSON: /api/errors/2858059b04303b79.
Report an issue: GitHub.