{"record":{"id":"814fb4b1b4c0807e","repo":"ungoogled-software/ungoogled-chromium","slug":"7z-command-returned-s","errorCode":null,"errorMessage":"7z command returned %s","messagePattern":"7z command returned (.+?)","errorType":"exception","errorClass":"ChildProcessError","httpStatus":null,"severity":"error","filePath":"utils/_extraction.py","lineNumber":276,"sourceCode":"    sevenzip_cmd = extractors.get(ExtractorEnum.SEVENZIP)\n    if sevenzip_cmd == USE_REGISTRY:\n        if not get_running_platform() == PlatformEnum.WINDOWS:\n            get_logger().error('\"%s\" for 7-zip is only available on Windows', sevenzip_cmd)\n            raise EnvironmentError()\n        sevenzip_cmd = str(_find_7z_by_registry())\n    sevenzip_bin = _find_extractor_by_cmd(sevenzip_cmd)\n\n    if not relative_to is None and (output_dir / relative_to).exists():\n        get_logger().error('Temporary unpacking directory already exists: %s',\n                           output_dir / relative_to)\n        raise FileExistsError()\n    cmd = (sevenzip_bin, 'x', str(archive_path), '-aoa', f'-o{str(output_dir)}')\n    get_logger().debug('7z command line: %s', ' '.join(cmd))\n\n    result = subprocess.run(cmd, check=False)\n    if result.returncode != 0:\n        get_logger().error('7z command returned %s', result.returncode)\n        raise ChildProcessError()\n\n    _process_relative_to(output_dir, relative_to)\n\n\ndef extract_with_winrar(archive_path, output_dir, relative_to, extractors=None):\n    \"\"\"\n    Extract archives with WinRAR into the output directory.\n    Only supports archives with one layer of unpacking, so compressed tar archives don't work.\n\n    archive_path is the pathlib.Path to the archive to unpack\n    output_dir is a pathlib.Path to the directory to unpack. It must already exist.\n\n    relative_to is a pathlib.Path for directories that should be stripped relative to the\n    root of the archive.\n    extractors is a dictionary of PlatformEnum to a command or path to the\n    extractor binary. Defaults to 'tar' for tar, and '_use_registry' for WinRAR.\n    \"\"\"\n    if extractors is None:","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/ungoogled-software/ungoogled-chromium/blob/f85e84a480e2e17c103de7013de94320f9a2ba39/utils/_extraction.py#L258-L294","documentation":"extract_with_7z runs '7z x archive -aoa -ooutput_dir'; a non-zero exit code is logged and raised as ChildProcessError, indicating 7z failed to extract the archive.","triggerScenarios":"Corrupt or unsupported archive (e.g. non-7z formats passed in, encrypted archives), missing/old 7z binary, disk full, or wrong archive_path (file not actually a 7z-capable format).","commonSituations":"Password-protected archives, p7zip classic lacking newer codecs, antivirus quarantine mid-extract on Windows, or pointing the extractor at a .tar.xz it cannot fully process in one step.","solutions":["Run the 7z command manually to see the real error output","Check the archive integrity: 7z t archive","Upgrade 7-zip or choose an extractor matching the archive format (extract_tar_file for .tar.*)","Ensure any required password is available or decrypt the archive first"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import subprocess\nprobe = subprocess.run([sevenzip_bin, 't', str(archive_path)], capture_output=True)\nif probe.returncode != 0:\n    raise RuntimeError(f'7z integrity test failed: {probe.stderr!r}')","typeGuard":null,"tryCatchPattern":"try:\n    extract_with_7z(archive, out, relative_to=rel)\nexcept ChildProcessError:\n    logger.exception('7z extraction failed; verify archive and binary')\n    raise","preventionTips":["Run 7z t on archives before extraction","Match extractor to archive format (7z vs tar archives)","Upgrade 7-zip for newer codecs","Handle encrypted archives with an interactive prompt or pre-decryption"],"tags":["subprocess","archive-extraction","nonzero-exit"],"backgroundTag":"extractor-nonzero-exit-code","analyzedSha":"f85e84a480e2e17c103de7013de94320f9a2ba39","analyzedAt":"2026-08-29T10:07:17.606Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}