{"record":{"id":"181b7bb4e6a2eadc","repo":"ungoogled-software/ungoogled-chromium","slug":"tar-command-returned-s","errorCode":null,"errorMessage":"tar command returned %s","messagePattern":"tar command returned (.+?)","errorType":"exception","errorClass":"ChildProcessError","httpStatus":null,"severity":"error","filePath":"utils/_extraction.py","lineNumber":121,"sourceCode":"    (stdout_data, stderr_data) = proc2.communicate()\n    if proc2.returncode != 0:\n        get_logger().error('7z commands returned non-zero status: %s', proc2.returncode)\n        get_logger().debug('stdout: %s', stdout_data)\n        get_logger().debug('stderr: %s', stderr_data)\n        raise ChildProcessError()\n\n    _process_relative_to(output_dir, relative_to)\n\n\ndef _extract_tar_with_tar(binary, archive_path, output_dir, relative_to):\n    get_logger().debug('Using BSD or GNU tar extractor')\n    output_dir.mkdir(exist_ok=True)\n    cmd = (binary, '-xf', str(archive_path), '-C', str(output_dir))\n    get_logger().debug('tar command line: %s', ' '.join(cmd))\n    result = subprocess.run(cmd, check=False)\n    if result.returncode != 0:\n        get_logger().error('tar command returned %s', result.returncode)\n        raise ChildProcessError()\n\n    # for gnu tar, the --transform option could be used. but to keep compatibility with\n    # bsdtar on macos, we just do this ourselves\n    _process_relative_to(output_dir, relative_to)\n\n\ndef _extract_tar_with_winrar(binary, archive_path, output_dir, relative_to):\n    get_logger().debug('Using WinRAR extractor')\n    output_dir.mkdir(exist_ok=True)\n    cmd = (binary, 'x', '-o+', str(archive_path), str(output_dir))\n    get_logger().debug('WinRAR command line: %s', ' '.join(cmd))\n    result = subprocess.run(cmd, check=False)\n    if result.returncode != 0:\n        get_logger().error('WinRAR command returned %s', result.returncode)\n        raise ChildProcessError()\n\n    _process_relative_to(output_dir, relative_to)\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/ungoogled-software/ungoogled-chromium/blob/f85e84a480e2e17c103de7013de94320f9a2ba39/utils/_extraction.py#L103-L139","documentation":"_extract_tar_with_tar runs the system tar binary with '-xf archive -C output_dir'; a non-zero exit status is logged and re-raised as ChildProcessError. Extraction did not complete successfully.","triggerScenarios":"Corrupt/truncated archive, tar lacking support for the compression filter (e.g. zstd on old bsdtar/GNU tar), unsupported archive format, or unwritable output_dir.","commonSituations":"macOS bsdtar or an old GNU tar without zstd support, .tar.zst archives on older CI images, disk quota exceeded, or SELinux/permission problems on the destination.","solutions":["Run tar -xf manually to see the real error message","Install/upgrade tar with the needed filter support (e.g. zstd) or pre-decompress the archive","Verify archive integrity (tar -tf) before extracting","Check write permissions and free space on output_dir"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import subprocess\nr = subprocess.run([tar_bin, '-tf', str(archive_path)], capture_output=True)\nif r.returncode != 0:\n    raise RuntimeError(f'tar cannot read archive: {r.stderr!r}')","typeGuard":null,"tryCatchPattern":"try:\n    extract_tar_file(archive, out)\nexcept ChildProcessError:\n    logger.exception('system tar failed; check tar version and filters')\n    # retry after pre-decompressing or with another extractor","preventionTips":["Check tar --version supports the archive's compression (zstd, etc.)","Pre-decompress .tar.zst/.tar.xz if the target system's tar is old","Validate archive integrity before extraction","Ensure output_dir is writable and has free space"],"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"}