{"record":{"id":"bf5a44fdd5522d72","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"errdesc-or-error-running-command-command-co","errorCode":null,"errorMessage":"{errdesc or 'Error running command'}.\nCommand: {command}\nError code: {result.returncode}\nstdout: {result.stdout}\nstderr: {result.stderr}","messagePattern":"(.+?)\\.\nCommand: (.+?)\nError code: (.+?)\nstdout: (.+?)\nstderr: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"modules/launch_utils.py","lineNumber":116,"sourceCode":"        \"errors\": 'ignore',\r\n    }\r\n\r\n    if not live:\r\n        run_kwargs[\"stdout\"] = run_kwargs[\"stderr\"] = subprocess.PIPE\r\n\r\n    result = subprocess.run(**run_kwargs)\r\n\r\n    if result.returncode != 0:\r\n        error_bits = [\r\n            f\"{errdesc or 'Error running command'}.\",\r\n            f\"Command: {command}\",\r\n            f\"Error code: {result.returncode}\",\r\n        ]\r\n        if result.stdout:\r\n            error_bits.append(f\"stdout: {result.stdout}\")\r\n        if result.stderr:\r\n            error_bits.append(f\"stderr: {result.stderr}\")\r\n        raise RuntimeError(\"\\n\".join(error_bits))\r\n\r\n    return (result.stdout or \"\")\r\n\r\n\r\ndef is_installed(package):\r\n    try:\r\n        dist = importlib.metadata.distribution(package)\r\n    except importlib.metadata.PackageNotFoundError:\r\n        try:\r\n            spec = importlib.util.find_spec(package)\r\n        except ModuleNotFoundError:\r\n            return False\r\n\r\n        return spec is not None\r\n\r\n    return dist is not None\r\n\r\n\r","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/launch_utils.py#L98-L134","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the stderr/stdout lines embedded in the exception — they contain the actual pip/git error to fix.","For network issues, set a mirror/proxy (e.g. PIP_INDEX_URL, HTTPS_PROXY) and re-launch so the command retries cleanly.","Recreate the venv (python -m venv venv --clear) or fix the Python version (usually 3.10.x is required) so package installs succeed.","If the failing step is optional for your setup, use the corresponding --skip-* / COMMANDLINE_ARGS flags to bypass it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    run(cmd, 'Installing deps', 'Install failed', live=True)\nexcept RuntimeError as e:\n    log.exception(e)          # message already embeds command, rc, stdout, stderr\n    sys.exit(1)               # fail fast; fix root cause from stderr, never retry blindly","preventionTips":["Pre-install dependencies in a controlled CI step so launch-time installs are rare.","Set pip mirrors/proxies via env (PIP_INDEX_URL, HTTPS_PROXY) for restricted networks.","Pin Python 3.10.x and keep the venv on a writable, non-full disk."],"tags":["startup","subprocess","pip","launch","environment"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}