{"record":{"id":"cfac8160ed7b00bb","repo":"SeleniumHQ/selenium","slug":"downloaded-file-cannot-be-uncompressed-extensi","errorCode":null,"errorMessage":"Downloaded file cannot be uncompressed ({} extension)","messagePattern":"Downloaded file cannot be uncompressed \\((.+?) extension\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/files.rs","lineNumber":195,"sourceCode":"        )?\n    } else if extension.eq_ignore_ascii_case(PKG) {\n        uncompress_pkg(compressed_file, target, log)?\n    } else if extension.eq_ignore_ascii_case(DMG) {\n        uncompress_dmg(compressed_file, target, log, volume.unwrap_or_default())?\n    } else if extension.eq_ignore_ascii_case(EXE) {\n        uncompress_sfx(compressed_file, target, log)?\n    } else if extension.eq_ignore_ascii_case(DEB) {\n        uncompress_deb(compressed_file, target, log, volume.unwrap_or_default())?\n    } else if extension.eq_ignore_ascii_case(MSI) {\n        install_msi(compressed_file, log, os)?\n    } else if extension.eq_ignore_ascii_case(XML) || extension.eq_ignore_ascii_case(HTML) {\n        log.debug(format!(\n            \"Wrong downloaded driver: {}\",\n            fs::read_to_string(compressed_file).unwrap_or_default()\n        ));\n        return Err(anyhow!(PARSE_ERROR));\n    } else {\n        return Err(anyhow!(format!(\n            \"Downloaded file cannot be uncompressed ({} extension)\",\n            extension\n        )));\n    }\n\n    Ok(())\n}\n\npub fn uncompress_sfx(compressed_file: &str, target: &Path, log: &Logger) -> Result<(), Error> {\n    let zip_parent = Path::new(compressed_file).parent().unwrap();\n    log.trace(format!(\n        \"Decompressing {} to {}\",\n        compressed_file,\n        zip_parent.display()\n    ));\n\n    let file_bytes = read_bytes_from_file(compressed_file)?;\n    let header = find_bytes(&file_bytes, SEVEN_ZIP_HEADER);","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/files.rs#L177-L213","documentation":"Raised in uncompress() (files.rs:195) when `infer` successfully detects a file type but its extension is none of the supported containers (zip/gz/bz2/xz/pkg/dmg/exe/deb/msi/xml/html). Selenium Manager cannot decompress the unknown format and reports the extension.","triggerScenarios":"The if-chain at lines 162-194 finds no matching extension after `infer` returned a known kind. The final else returns the error with the detected extension. Example: a .7z or .rar archive, or a .tar without compression handled differently.","commonSituations":"Upstream changes packaging to a new format (e.g. .zst); a mirror serves a recompressed archive; a corrupted download is misidentified by `infer`; an exotic driver ships an unsupported container.","solutions":["Inspect the file type with `file <path>` and confirm the extension shown in the error.","Re-download to rule out a corrupted/misidentified file.","If the upstream format genuinely changed, extend the if-chain in uncompress() to handle it.","Verify the mirror URL serves the original archive format."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Bash: confirm the archive format is supported before extraction\nSUPPORTED='zip gz bz2 xz pkg dmg exe deb msi'\nEXT=${FILE##*.}\nif ! echo \" $SUPPORTED \" | grep -iq \" $EXT \"; then\n  echo \"Unsupported archive format: $EXT\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":"match uncompress(file, target, &log, os, single, vol) {\n    Ok(()) => (),\n    Err(e) if e.to_string().contains(\"cannot be uncompressed\") => {\n        eprintln!(\"Unsupported extension {}; re-download or convert\", file);\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Verify the archive format with `file` before extraction.","Re-download if the format is unexpected (corruption can change inference).","Keep Selenium Manager updated to support new upstream formats."],"tags":["rust","selenium-manager","archive","file-format","download"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}