{"record":{"id":"a92dfa60dfe52aa2","repo":"apache/beam","slug":"full-trace-n-output-of-the-failed-child-process-processes","errorCode":null,"errorMessage":"Full trace: {} \\n Output of the failed child process: {}","messagePattern":"Full trace: (.+?) \\\\n Output of the failed child process: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/utils/processes.py","lineNumber":80,"sourceCode":"           \\n Output of the failed child process: {} \" \\\n          .format(traceback.format_exc(), error.output)) from error\n    return out\n\n  def check_call(*args, **kwargs):\n    if force_shell:\n      kwargs['shell'] = True\n    try:\n      out = subprocess.check_call(*args, **kwargs)\n    except OSError as e:\n      raise RuntimeError(\"Executable {} not found\".format(args[0])) from e\n    except subprocess.CalledProcessError as error:\n      if isinstance(args, tuple) and (args[0][2] == \"pip\"):\n        raise RuntimeError( \\\n          \"Full traceback: {} \\n Pip install failed for package: {} \\\n          \\n Output from execution of subprocess: {}\" \\\n          .format(traceback.format_exc(), args[0][6], error.output)) from error\n      else:\n        raise RuntimeError(\"Full trace: {} \\\n          \\n Output of the failed child process: {}\" \\\n          .format(traceback.format_exc(), error.output)) from error\n    return out\n\n  def check_output(*args, **kwargs):\n    if force_shell:\n      kwargs['shell'] = True\n    try:\n      out = subprocess.check_output(*args, **kwargs)\n    except OSError as e:\n      raise RuntimeError(\"Executable {} not found\".format(args[0])) from e\n    except subprocess.CalledProcessError as error:\n      if isinstance(args, tuple) and (args[0][2] == \"pip\"):\n        raise RuntimeError( \\\n          \"Full traceback: {} \\n Pip install failed for package: {} \\\n          \\n Output from execution of subprocess: {}\" \\\n          .format(traceback.format_exc(), args[0][6], error.output)) from error\n      else:","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/utils/processes.py#L62-L98","documentation":"RuntimeError raised from the subprocess wrapper `check_call` when the spawned child (again typically pip install) failed; it rewraps CalledProcessError with the full traceback and the child process's output for diagnosability.","triggerScenarios":"Any processes.check_call(...) whose child process returns a nonzero exit code and whose argv[0][2] is not 'pip'.","commonSituations":"Failing shell utilities (grep with no matches returns 1, test scripts), wrong CLI flags, tools requiring auth or missing inputs inside pipeline workers.","solutions":["Inspect 'Output of the failed child process' in the exception for the real cause","Re-run the command locally with identical arguments/environment","Handle expected nonzero exits with processes.call instead of check_call, or catch RuntimeError","Fix flags, inputs, or credentials the child tool needs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"result = subprocess.run(['tool', '--version'], capture_output=True)\nassert result.returncode == 0, result.stderr  # tool works before real invocation","typeGuard":null,"tryCatchPattern":"try:\n    processes.check_call('tool', '--do')\nexcept RuntimeError as e:\n    if 'Output of the failed child process' in str(e):\n        logging.error('tool failed: %s', e)\n        handle_child_failure()\n    else:\n        raise","preventionTips":["Smoke-test child tools with --version at startup","Use processes.call when nonzero exit codes are expected/acceptable","Log the embedded child output for diagnosis","Match CLI flags to the exact tool version deployed"],"tags":["python","subprocess","command-failed"],"backgroundTag":"command-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}