ungoogled-software/ungoogled-chromium · error · ChildProcessError

tar command returned %s

Error message

tar command returned %s

What it means

_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.

Source

Thrown at utils/_extraction.py:121

    (stdout_data, stderr_data) = proc2.communicate()
    if proc2.returncode != 0:
        get_logger().error('7z commands returned non-zero status: %s', proc2.returncode)
        get_logger().debug('stdout: %s', stdout_data)
        get_logger().debug('stderr: %s', stderr_data)
        raise ChildProcessError()

    _process_relative_to(output_dir, relative_to)


def _extract_tar_with_tar(binary, archive_path, output_dir, relative_to):
    get_logger().debug('Using BSD or GNU tar extractor')
    output_dir.mkdir(exist_ok=True)
    cmd = (binary, '-xf', str(archive_path), '-C', str(output_dir))
    get_logger().debug('tar command line: %s', ' '.join(cmd))
    result = subprocess.run(cmd, check=False)
    if result.returncode != 0:
        get_logger().error('tar command returned %s', result.returncode)
        raise ChildProcessError()

    # for gnu tar, the --transform option could be used. but to keep compatibility with
    # bsdtar on macos, we just do this ourselves
    _process_relative_to(output_dir, relative_to)


def _extract_tar_with_winrar(binary, archive_path, output_dir, relative_to):
    get_logger().debug('Using WinRAR extractor')
    output_dir.mkdir(exist_ok=True)
    cmd = (binary, 'x', '-o+', str(archive_path), str(output_dir))
    get_logger().debug('WinRAR command line: %s', ' '.join(cmd))
    result = subprocess.run(cmd, check=False)
    if result.returncode != 0:
        get_logger().error('WinRAR command returned %s', result.returncode)
        raise ChildProcessError()

    _process_relative_to(output_dir, relative_to)

View on GitHub (pinned to f85e84a480)

Solutions

  1. Run tar -xf manually to see the real error message
  2. Install/upgrade tar with the needed filter support (e.g. zstd) or pre-decompress the archive
  3. Verify archive integrity (tar -tf) before extracting
  4. Check write permissions and free space on output_dir
Defensive patterns

Strategy: try-catch

Validate before calling

import subprocess
r = subprocess.run([tar_bin, '-tf', str(archive_path)], capture_output=True)
if r.returncode != 0:
    raise RuntimeError(f'tar cannot read archive: {r.stderr!r}')

Try / catch

try:
    extract_tar_file(archive, out)
except ChildProcessError:
    logger.exception('system tar failed; check tar version and filters')
    # retry after pre-decompressing or with another extractor

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of ungoogled-software/ungoogled-chromium@f85e84a480 (2026-08-29). Data as JSON: /api/errors/181b7bb4e6a2eadc. Report an issue: GitHub.