{"record":{"id":"44dca0b70623c83a","repo":"apache/hadoop","slug":"job-failed","errorCode":null,"errorMessage":"Job failed!","messagePattern":"Job failed!","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java","lineNumber":875,"sourceCode":"      return stats;\n    } catch (InterruptedException ie) {\n      throw new IOException(ie);\n    }\n  }\n  \n  /** \n   * Utility that submits a job, then polls for progress until the job is\n   * complete.\n   * \n   * @param job the job configuration.\n   * @throws IOException if the job fails\n   */\n  public static RunningJob runJob(JobConf job) throws IOException {\n    JobClient jc = new JobClient(job);\n    RunningJob rj = jc.submitJob(job);\n    try {\n      if (!jc.monitorAndPrintJob(job, rj)) {\n        throw new IOException(\"Job failed!\");\n      }\n    } catch (InterruptedException ie) {\n      Thread.currentThread().interrupt();\n    }\n    return rj;\n  }\n  \n  /**\n   * Monitor a job and print status in real-time as progress is made and tasks \n   * fail.\n   * @param conf the job's configuration\n   * @param job the job to track\n   * @return true if the job succeeded\n   * @throws IOException if communication to the JobTracker fails\n   */\n  public boolean monitorAndPrintJob(JobConf conf, \n                                    RunningJob job\n  ) throws IOException, InterruptedException {","sourceCodeStart":857,"sourceCodeEnd":893,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java#L857-L893","documentation":"Fires in JobClient.runJob after the job has been submitted and monitored: monitorAndPrintJob returned false, meaning the job finished in the FAILED or KILLED state rather than succeeding. runJob turns that unsuccessful terminal state into an IOException(\"Job failed!\") so callers using the old mapred API's blocking runJob get an exception instead of a silently failed RunningJob.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java:875 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the job's task logs and counters to find the failing task, fix the underlying cause, and resubmit the job."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}