apache/hadoop · error · RuntimeException

Not Found: {}

Error message

Not Found: {}

What it means

requireJob parsed the job id (a malformed id fails earlier inside MRApps.toJobID) but app.context.getJob(jobID) returned null: this ApplicationMaster does not know the job. The UI answers 404 with 'Not Found: <jobid>'.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppController.java:419

      return false;
    }
    return true;
  }

  /**
   * Ensure that a JOB_ID was passed into the page.
   */
  public void requireJob() {
    if ($(JOB_ID).isEmpty()) {
      badRequest("missing job ID");
      throw new RuntimeException("Bad Request: Missing job ID");
    }

    JobId jobID = MRApps.toJobID($(JOB_ID));
    app.setJob(app.context.getJob(jobID));
    if (app.getJob() == null) {
      notFound($(JOB_ID));
      throw new RuntimeException("Not Found: " + $(JOB_ID));
    }

    /* check for acl access */
    Job job = app.context.getJob(jobID);
    if (!checkAccess(job)) {
      accessDenied("User " + request().getRemoteUser() + " does not have " +
          " permission to view job " + $(JOB_ID));
      throw new RuntimeException("Access denied: User " +
          request().getRemoteUser() + " does not have permission to view job " +
          $(JOB_ID));
    }
  }

  /**
   * Ensure that a TASK_ID was passed into the page.
   */
  public void requireTask() {
    if ($(TASK_ID).isEmpty()) {

View on GitHub (pinned to 2add963021)

Solutions

  1. Verify the job still runs via the ResourceManager UI/API and open its current tracking URL
  2. For completed jobs use the Job History Server UI (port 19888)
  3. Check the full id including the sequence number after the timestamp

Example fix

// before: stale AM link for a finished job
http://am-host:8099/job?job.id=job_1401318629735_0001
// 404 Not Found: job_1401318629735_0001

// after: history server for finished jobs
http://jhs-host:19888/jobhistory/job/job_1401318629735_0001
Defensive patterns

Strategy: validation

Validate before calling

// Resolve the live tracking URL from the RM instead of hard-coding an AM address
ApplicationReport r = yarnApps.get(appId);
YarnApplicationState s = r.getYarnApplicationState();
if (s == YarnApplicationState.FINISHED || s == YarnApplicationState.FAILED
    || s == YarnApplicationState.KILLED) {
  // AM is gone: use the Job History Server UI instead
} else {
  String ui = r.getTrackingUrl(); // live AM UI with job.id links
}

Try / catch

try {
  open(amUrl + "/job?job.id=" + jobId);
} catch (PageNotFoundException e404) {
  // AM no longer serves this job: fall back to history server
  open("http://" + jhsHost + ":19888/jobhistory/job/" + jobId);
}

Prevention

When it happens

Trigger: Querying the AM UI with a job id served by a different ApplicationMaster; the job already finished and its AM exited; wrong port reached (another app's AM); id well-formed but never existed.

Common situations: Old link followed after job completion; ResourceManager restart left the tracking URL stale; several MR jobs running and ids confused between them.

Related errors


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