AUTOMATIC1111/stable-diffusion-webui · critical · RuntimeError

{errdesc or 'Error running command'}. Command: {command} Err

Error message

{errdesc or 'Error running command'}.
Command: {command}
Error code: {result.returncode}
stdout: {result.stdout}
stderr: {result.stderr}

What it means

This is launch_utils.run(): it executes a subprocess (pip install, git, python checks) with subprocess.run and, if the return code is non-zero, assembles errdesc, the command, return code, stdout and stderr into a RuntimeError. It is the generic wrapper for every external command the launcher runs during startup/webui preparation.

Source

Thrown at modules/launch_utils.py:116

        "errors": 'ignore',
    }

    if not live:
        run_kwargs["stdout"] = run_kwargs["stderr"] = subprocess.PIPE

    result = subprocess.run(**run_kwargs)

    if result.returncode != 0:
        error_bits = [
            f"{errdesc or 'Error running command'}.",
            f"Command: {command}",
            f"Error code: {result.returncode}",
        ]
        if result.stdout:
            error_bits.append(f"stdout: {result.stdout}")
        if result.stderr:
            error_bits.append(f"stderr: {result.stderr}")
        raise RuntimeError("\n".join(error_bits))

    return (result.stdout or "")


def is_installed(package):
    try:
        dist = importlib.metadata.distribution(package)
    except importlib.metadata.PackageNotFoundError:
        try:
            spec = importlib.util.find_spec(package)
        except ModuleNotFoundError:
            return False

        return spec is not None

    return dist is not None


View on GitHub (pinned to 82a973c043)

Solutions

  1. Read the stderr/stdout lines embedded in the exception — they contain the actual pip/git error to fix.
  2. For network issues, set a mirror/proxy (e.g. PIP_INDEX_URL, HTTPS_PROXY) and re-launch so the command retries cleanly.
  3. Recreate the venv (python -m venv venv --clear) or fix the Python version (usually 3.10.x is required) so package installs succeed.
  4. If the failing step is optional for your setup, use the corresponding --skip-* / COMMANDLINE_ARGS flags to bypass it.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    run(cmd, 'Installing deps', 'Install failed', live=True)
except RuntimeError as e:
    log.exception(e)          # message already embeds command, rc, stdout, stderr
    sys.exit(1)               # fail fast; fix root cause from stderr, never retry blindly

Prevention

When it happens

Trigger: Any startup-time subprocess failing: pip install of torch/clip/open_clip failing on network or resolver errors, git clone/fetch of repositories failing, or a check command exiting non-zero while live=True.

Common situations: No internet or a proxy blocking PyPI/GitHub during first launch; incompatible Python version causing pip to fail building a wheel; disk full; corporate TLS interception breaking downloads; stale venv with broken package metadata.

Related errors


AI-assisted analysis of AUTOMATIC1111/stable-diffusion-webui@82a973c043 (2026-08-14). Data as JSON: /api/errors/bf5a44fdd5522d72. Report an issue: GitHub.