{"record":{"id":"e821e35d9594d597","repo":"SeleniumHQ/selenium","slug":"error-getting-parent-of","errorCode":null,"errorMessage":"Error getting parent of {:?}","messagePattern":"Error getting parent of (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/files.rs","lineNumber":447,"sourceCode":"    );\n    log.trace(format!(\"Running command: {}\", command.display()));\n    run_shell_command(command)?;\n\n    Ok(())\n}\n\npub fn untargz(compressed_file: &str, target: &Path, log: &Logger) -> Result<(), Error> {\n    log.trace(format!(\n        \"Untargz {} to {}\",\n        compressed_file,\n        target.display()\n    ));\n    let file = File::open(compressed_file)?;\n    let tar = GzDecoder::new(&file);\n    let mut archive = Archive::new(tar);\n    let parent_path = target\n        .parent()\n        .ok_or(anyhow!(format!(\"Error getting parent of {:?}\", file)))?;\n    if !target.exists() {\n        archive.unpack(parent_path)?;\n    }\n    Ok(())\n}\n\npub fn uncompress_tar(decoder: &mut dyn Read, target: &Path, log: &Logger) -> Result<(), Error> {\n    log.trace(format!(\n        \"Uncompress compressed tarball to {}\",\n        target.display()\n    ));\n    let mut buffer: Vec<u8> = Vec::new();\n    decoder.read_to_end(&mut buffer)?;\n    let mut archive = Archive::new(Cursor::new(buffer));\n    for entry in archive.entries()? {\n        let mut entry_decoder = entry?;\n        let path = entry_decoder.path()?;\n        let entry_path: PathBuf = if path.iter().count() > 1 {","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/files.rs#L429-L465","documentation":"Error \"Error getting parent of {:?}\" thrown in SeleniumHQ/selenium.","triggerScenarios":"Thrown at rust/src/files.rs:447 when the library encounters an invalid state.","commonSituations":"Occurs when a path has no parent directory (e.g., a filesystem root) while Selenium Manager tries to resolve it. Prevent it by passing a valid, non-root file path for downloads or cache locations.","solutions":["Check that the target path passed for extraction has a parent directory (it must not be the filesystem root)","Use a normal directory under the cache folder rather than '/' or a root-level path"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}