{"record":{"id":"b85120c1ef4f30d9","repo":"apache/hadoop","slug":"invalid-map-task-no-attempt-for-a-mapper","errorCode":null,"errorMessage":"Invalid map task, no attempt for a mapper!","messagePattern":"Invalid map task, no attempt for a mapper!","errorType":"exception","errorClass":"YarnException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/AMDefinitionRumen.java","lineNumber":55,"sourceCode":"    super(builder);\n  }\n\n  public static List<ContainerSimulator> getTaskContainers(LoggedJob job,\n      SLSRunner slsRunner) throws YarnException {\n    List<ContainerSimulator> containerList = new ArrayList<>();\n\n    TaskContainerDefinition.Builder builder =\n        TaskContainerDefinition.Builder.create()\n            .withCount(1)\n            .withResource(slsRunner.getDefaultContainerResource())\n            .withExecutionType(ExecutionType.GUARANTEED)\n            .withAllocationId(-1)\n            .withRequestDelay(0);\n\n    // mapper\n    for (LoggedTask mapTask : job.getMapTasks()) {\n      if (mapTask.getAttempts().size() == 0) {\n        throw new YarnException(\"Invalid map task, no attempt for a mapper!\");\n      }\n      LoggedTaskAttempt taskAttempt =\n          mapTask.getAttempts().get(mapTask.getAttempts().size() - 1);\n      TaskContainerDefinition containerDef = builder\n          .withHostname(taskAttempt.getHostName().getValue())\n          .withDuration(taskAttempt.getFinishTime() -\n              taskAttempt.getStartTime())\n          .withPriority(DEFAULT_MAPPER_PRIORITY)\n          .withType(\"map\")\n          .build();\n      containerList.add(\n          ContainerSimulator.createFromTaskContainerDefinition(containerDef));\n    }\n\n    // reducer\n    for (LoggedTask reduceTask : job.getReduceTasks()) {\n      if (reduceTask.getAttempts().size() == 0) {\n        throw new YarnException(","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/AMDefinitionRumen.java#L37-L73","documentation":"Error \"Invalid map task, no attempt for a mapper!\" thrown in apache/hadoop.","triggerScenarios":"A map task parsed from the Rumen trace has no attempt information, so the SLS AM simulator cannot schedule it.","commonSituations":"See trigger scenarios.","solutions":["Check the Rumen trace: every map task must have at least one attempt recorded."],"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-23T01:17:44.959Z"}