apache/hadoop · error · IOException

Unable to get log information for job: {oldJobID}

Error message

Unable to get log information for job: {oldJobID}

What it means

Thrown by ClientServiceDelegate.getLogFilePath when the job is finished, no task attempt id was supplied, and the job report's AMInfos list is null or empty. AMInfos records the ApplicationMaster's own container locations; without them the client cannot locate the job's logs and raises IOException. It typically means the job ended before any AM container registered — the classic signature of a job that failed at launch.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java:523

        taRequest.setTaskAttemptId(TypeConverter.toYarn(oldTaskAttemptID));
        TaskAttemptReport taReport =
            ((GetTaskAttemptReportResponse) invoke("getTaskAttemptReport",
                GetTaskAttemptReportRequest.class, taRequest))
                .getTaskAttemptReport();
        if (taReport.getContainerId() == null
            || taReport.getNodeManagerHost() == null) {
          throw new IOException("Unable to get log information for task: "
              + oldTaskAttemptID);
        }
        return new LogParams(
            taReport.getContainerId().toString(),
            taReport.getContainerId().getApplicationAttemptId()
                .getApplicationId().toString(),
            NodeId.newInstance(taReport.getNodeManagerHost(),
                taReport.getNodeManagerPort()).toString(), report.getUser());
      } else {
        if (report.getAMInfos() == null || report.getAMInfos().size() == 0) {
          throw new IOException("Unable to get log information for job: "
              + oldJobID);
        }
        AMInfo amInfo = report.getAMInfos().get(report.getAMInfos().size() - 1);
        return new LogParams(
            amInfo.getContainerId().toString(),
            amInfo.getAppAttemptId().getApplicationId().toString(),
            NodeId.newInstance(amInfo.getNodeManagerHost(),
                amInfo.getNodeManagerPort()).toString(), report.getUser());
      }
    } else {
      throw new IOException("Cannot get log path for a in-progress job");
    }
  }

  public void close() throws IOException {
    if (rm != null) {
      rm.close();
    }

View on GitHub (pinned to 2add963021)

Solutions

  1. Inspect the failure cause: yarn application -status / RM logs for the app's diagnostics — the AM never started, so logs of the job itself do not exist
  2. If you need client-side logs, use `yarn logs -applicationId` which reads whatever the NM aggregated (often just launch errors)
  3. Fix the underlying launch failure (job jar path, AM resources, main class) before requesting log paths
  4. Do not call getLogFileParams for jobs whose report shows zero AM attempts — guard on report.getAMInfos()

Example fix

// before
LogParams lp = clusterClient.getLogFileParams(jobId, null); // throws: AMInfos empty

// after
JobReport rpt = ...;
if (rpt.getAMInfos() == null || rpt.getAMInfos().isEmpty()) {
  throw new IllegalStateException("job never started an AM - see RM diagnostics");
}
LogParams lp = clusterClient.getLogFileParams(jobId, null);
Defensive patterns

Strategy: try-catch

Validate before calling

JobReport rpt = getReport(jobId);
boolean amEverRan = rpt.getAMInfos() != null && !rpt.getAMInfos().isEmpty();
if (!amEverRan) return amLaunchDiagnostics(appId); // no logs exist, show why

Try / catch

try {
  LogParams lp = cluster.getLogFileParams(jobId);
} catch (IOException e) {
  if (e.getMessage().contains("Unable to get log information for job"))
    return yarnApplicationDiagnostics(appId); // AM never started
  throw e;
}

Prevention

When it happens

Trigger: Calling getLogFileParams for a job that FAILED/KILLED before the AM started or before its first heartbeat registered AM info (e.g. AM container launch failure, unrecoverable speculator state, job killed in NEW/NEW_SAVING/SUBMITTED).

Common situations: AM container failures: bad job jar, missing main class, insufficient container resources, node loss during launch; Job killed immediately after submission (yarn application -kill or queue ACL rejection after accept); RM or AM restart scenarios where history/AM info was never populated

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/0a7a07e708d17cf7. Report an issue: GitHub.