ungoogled-software/ungoogled-chromium · error · ChildProcessError

7z commands returned non-zero status: %s

Error message

7z commands returned non-zero status: %s

What it means

_extract_tar_with_7z pipes two 7z processes (archive -> stdout, stdout -> files). If the second 7z process exits non-zero the function logs the status and stdout/stderr and raises ChildProcessError, meaning the tar stream extraction failed.

Source

Thrown at utils/_extraction.py:108

def _extract_tar_with_7z(binary, archive_path, output_dir, relative_to):
    get_logger().debug('Using 7-zip extractor')
    if not relative_to is None and (output_dir / relative_to).exists():
        get_logger().error('Temporary unpacking directory already exists: %s',
                           output_dir / relative_to)
        raise FileExistsError()
    cmd1 = (binary, 'x', str(archive_path), '-so')
    cmd2 = (binary, 'x', '-si', '-snld', '-aoa', '-ttar', f'-o{str(output_dir)}')
    get_logger().debug('7z command line: %s | %s', ' '.join(cmd1), ' '.join(cmd2))

    proc1 = subprocess.Popen(cmd1, stdout=subprocess.PIPE) #pylint: disable=consider-using-with
    proc2 = subprocess.Popen(cmd2, stdin=proc1.stdout, stdout=subprocess.PIPE) #pylint: disable=consider-using-with
    proc1.stdout.close()
    (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)

View on GitHub (pinned to f85e84a480)

Solutions

  1. Test the archive manually: 7z x archive.tar.xz -so | 7z x -si -ttar -oout and read stderr
  2. Upgrade 7-zip to a current release or fall back to the tar/python extractor
  3. Re-download or re-create the archive to rule out corruption
  4. Check free disk space on output_dir's filesystem
Defensive patterns

Strategy: try-catch

Validate before calling

import subprocess
probe = subprocess.run([sevenzip_bin, 't', str(archive_path)], capture_output=True)
if probe.returncode != 0:
    raise RuntimeError(f'archive integrity check failed: {probe.stderr!r}')

Try / catch

try:
    extract_tar_file(archive, out)
except ChildProcessError:
    # log archive checksum, disk space, and 7z version; fall back
    extract_with_python_fallback(archive, out)

Prevention

When it happens

Trigger: Corrupt or truncated archive, 7z binary that cannot handle the compression (e.g. xz/zstd filters unsupported in that 7z build), insufficient disk space, or the first 7z process dying mid-stream.

Common situations: Outdated p7zip (classic) lacking modern filters like zstd, partially downloaded .tar.xz, antivirus interfering on Windows, or disk-full during unpacking.

Related errors


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