{"record":{"id":"b7a8e1255eb8d92b","repo":"tensorflow/models","slug":"error-executing-command-cmd-error-stderr","errorCode":null,"errorMessage":"Error executing command: {cmd}. Error: {stderr}","messagePattern":"Error executing command: (.+?)\\. Error: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/model_inference/download_and_unzip_models.py","lineNumber":67,"sourceCode":"  def __init__(self, cmd, returncode, stderr):\n    super().__init__(f\"Error executing command: {cmd}. Error: {stderr}\")\n    self.cmd = cmd\n    self.returncode = returncode\n    self.stderr = stderr\n\n\ndef execute_command(cmd: str) -> str:\n  \"\"\"Executes a shell command and returns its output.\"\"\"\n  result = subprocess.run(\n      cmd,\n      shell=True,\n      stdout=subprocess.PIPE,\n      stderr=subprocess.PIPE,\n      check=False,\n  )\n\n  if result.returncode != 0:\n    raise CommandExecutionError(\n        cmd, result.returncode, result.stderr.decode(\"utf-8\")\n    )\n\n  return result.stdout.decode(\"utf-8\")\n\n\ndef main(_) -> None:\n  # Download the provided files\n  execute_command(f\"wget {args.material_url}\")\n  execute_command(f\"wget {args.material_form_url}\")\n\n  # Create directories\n  os.makedirs(\"material\", exist_ok=True)\n  os.makedirs(\"material_form\", exist_ok=True)\n\n  # Unzip the provided files\n  zip_file1 = os.path.basename(args.material_url)\n  zip_file2 = os.path.basename(args.material_form_url)","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/model_inference/download_and_unzip_models.py#L49-L85","documentation":"Error \"Error executing command: {cmd}. Error: {stderr}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/model_inference/download_and_unzip_models.py:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}