{"record":{"id":"cdf2dd0e8a3718ab","repo":"apache/hadoop","slug":"taskid-cannot-be-null","errorCode":null,"errorMessage":"taskId cannot be null","messagePattern":"taskId cannot be null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/TaskAttemptID.java","lineNumber":62,"sourceCode":" * \n * @see JobID\n * @see TaskID\n */\n@InterfaceAudience.Public\n@InterfaceStability.Stable\npublic class TaskAttemptID extends org.apache.hadoop.mapred.ID {\n  protected static final String ATTEMPT = \"attempt\";\n  private TaskID taskId;\n  \n  /**\n   * Constructs a TaskAttemptID object from given {@link TaskID}.  \n   * @param taskId TaskID that this task belongs to  \n   * @param id the task attempt number\n   */\n  public TaskAttemptID(TaskID taskId, int id) {\n    super(id);\n    if(taskId == null) {\n      throw new IllegalArgumentException(\"taskId cannot be null\");\n    }\n    this.taskId = taskId;\n  }\n  \n  /**\n   * Constructs a TaskId object from given parts.\n   * @param jtIdentifier jobTracker identifier\n   * @param jobId job number \n   * @param type the TaskType \n   * @param taskId taskId number\n   * @param id the task attempt number\n   */\n  public TaskAttemptID(String jtIdentifier, int jobId, TaskType type, \n                       int taskId, int id) {\n    this(new TaskID(jtIdentifier, jobId, type, taskId), id);\n  }\n\n  /**","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/TaskAttemptID.java#L44-L80","documentation":"Error \"taskId cannot be null\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/TaskAttemptID.java:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null TaskID when constructing the TaskAttemptID."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}