{"record":{"id":"439ccbcb28624679","repo":"apache/hadoop","slug":"unrecognized-status","errorCode":null,"errorMessage":"Unrecognized status: {}","messagePattern":"Unrecognized status: (.+?)","errorType":"exception","errorClass":"YarnRuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java","lineNumber":228,"sourceCode":"              fromYarn(newEvent.getStatus()),\n              newEvent.getMapOutputServerAddress());\n  }\n\n  public static TaskCompletionEvent.Status fromYarn(\n      TaskAttemptCompletionEventStatus newStatus) {\n    switch (newStatus) {\n    case FAILED:\n      return TaskCompletionEvent.Status.FAILED;\n    case KILLED:\n      return TaskCompletionEvent.Status.KILLED;\n    case OBSOLETE:\n      return TaskCompletionEvent.Status.OBSOLETE;\n    case SUCCEEDED:\n      return TaskCompletionEvent.Status.SUCCEEDED;\n    case TIPFAILED:\n      return TaskCompletionEvent.Status.TIPFAILED;\n    }\n    throw new YarnRuntimeException(\"Unrecognized status: \" + newStatus);\n  }\n\n  public static org.apache.hadoop.mapred.TaskAttemptID fromYarn(\n      TaskAttemptId id) {\n    return new org.apache.hadoop.mapred.TaskAttemptID(fromYarn(id.getTaskId()),\n        id.getId());\n  }\n\n  public static TaskAttemptId toYarn(\n      org.apache.hadoop.mapred.TaskAttemptID id) {\n    TaskAttemptId taskAttemptId = recordFactory.newRecordInstance(TaskAttemptId.class);\n    taskAttemptId.setTaskId(toYarn(id.getTaskID()));\n    taskAttemptId.setId(id.getId());\n    return taskAttemptId;\n  }\n\n  public static TaskAttemptId toYarn(\n      org.apache.hadoop.mapreduce.TaskAttemptID id) {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java#L210-L246","documentation":"TypeConverter.fromYarn(TaskCompletionEventStatus) translates MRv2 completion-event statuses (FAILED, KILLED, OBSOLETE, SUCCEEDED, TIPFAILED) into the classic TaskCompletionEvent.Status; an unmapped constant falls through to YarnRuntimeException. TIPFAILED exists precisely because MRv2 can report whole-tip failure, so older statuses map cleanly — only genuinely new constants miss.","triggerScenarios":"A JobHistory/AM completion event whose status is not one of the five handled constants, typically from a cluster newer than the client jar parsing its output.","commonSituations":"Reading job history files or REST/RPC responses produced by a newer Hadoop with an older client; mixed-jar installs; tools replaying recorded protocol traces against a different build.","solutions":["Use a client jar matching the cluster version","Skip/log events with unknown statuses instead of aborting the whole loop","Catch YarnRuntimeException per-event when aggregating completion events"],"exampleFix":"// before\nfor (TaskAttemptCompletionEvent e : events) {\n  old[i++] = TypeConverter.fromYarn(e.getStatus()); // one bad status kills the loop\n}\n\n// after\nfor (TaskAttemptCompletionEvent e : events) {\n  try { old[i++] = TypeConverter.fromYarn(e.getStatus()); }\n  catch (YarnRuntimeException ex) { LOG.warn(\"Skipping event with status {}\", e.getStatus()); }\n}","handlingStrategy":"try-catch","validationCode":"private static final Set<TaskCompletionEventStatus> KNOWN = EnumSet.of(\n    TaskCompletionEventStatus.FAILED, TaskCompletionEventStatus.KILLED,\n    TaskCompletionEventStatus.OBSOLETE, TaskCompletionEventStatus.SUCCEEDED,\n    TaskCompletionEventStatus.TIPFAILED);\nif (KNOWN.contains(newStatus)) { converted = TypeConverter.fromYarn(newStatus); }","typeGuard":"static boolean isMappableCompletionStatus(TaskAttemptCompletionEventStatus s) {\n  return s == TaskAttemptCompletionEventStatus.FAILED\n      || s == TaskAttemptCompletionEventStatus.KILLED\n      || s == TaskAttemptCompletionEventStatus.OBSOLETE\n      || s == TaskAttemptCompletionEventStatus.SUCCEEDED\n      || s == TaskAttemptCompletionEventStatus.TIPFAILED;\n}","tryCatchPattern":"for (TaskAttemptCompletionEvent e : events) {\n  try {\n    out.add(TypeConverter.fromYarn(e.getStatus()));\n  } catch (YarnRuntimeException ex) {\n    LOG.warn(\"Skipping completion event with unknown status {}\", e.getStatus());\n  }\n}","preventionTips":["Process completion events one-by-one so a single unknown status can't kill the batch","Match client version to the JobHistory/AM producer version"],"tags":["hadoop","mapreduce","yarn","completion-event","enum-conversion","version-mismatch"],"backgroundTag":"unrecognized-enum-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}