apache/hadoop · error · FileNotFoundException

Key '" + key + "' does not exist in BOS

Error message

Key '" + key + "' does not exist in BOS

What it means

ZombieJob.getTaskAttemptInfo(loggedTask, loggedAttempt) dispatches on loggedTask.getTaskType(): MAP and REDUCE produce Map/ReduceTaskAttemptInfo, and the final else throws IllegalArgumentException naming the task ID and its type. The accepted set is exactly MAP and REDUCE — SETUP, CLEANUP, JOB_SETUP, JOB_CLEANUP, ACTION or a null type all fail here. This is the generic attempt-info path used for both map and reduce simulation.

Source

Thrown at hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BosClientProxyImpl.java:488

    if (bosClient != null) {
      bosClient.shutdown();
      bosClient = null;
    }
  }

  /**
   * Handles a BOS service exception with key context. If the
   * error is a 404, throws {@link FileNotFoundException}.
   *
   * @param key the object key involved in the operation
   * @param e   the BOS service exception
   * @throws IOException wrapping the service exception
   */
  private void handleBosServiceException(
      String key, BceServiceException e)
      throws IOException {
    if (BOS_NO_SUCH_KEY_CODE == e.getStatusCode()) {
      throw new FileNotFoundException(
          "Key '" + key + "' does not exist in BOS");
    } else {
      handleBosServiceException(e);
    }
  }

  /**
   * Handles a BOS service exception, translating it into the
   * appropriate IOException subclass based on status code and
   * error code.
   *
   * @param e the BOS service exception
   * @throws IOException wrapping the service exception
   */
  private void handleBosServiceException(
      BceServiceException e) throws IOException {
    // process all 400 status, because as token expired
    // bos server return "Error Code=null" when request

View on GitHub (pinned to 2add963021)

Solutions

  1. Iterate only over map and reduce tasks: filter LoggedJob.getMapTasks()/getReduceTasks() or check getTaskType() before requesting attempt info.
  2. If setup/cleanup work matters for your simulation, model its cost separately instead of routing it through getTaskAttemptInfo().
  3. Repair traces whose taskType is null/unknown — usually a sign of hand-editing or version mismatch.

Example fix

// before
for (LoggedTask t : loggedJob.getAllTasks()) {
  story.getTaskAttemptInfo(t, t.getAttempts().get(0)); // throws on SETUP/CLEANUP
}

// after
for (LoggedTask t : loggedJob.getAllTasks()) {
  Values type = t.getTaskType();
  if (type != Values.MAP && type != Values.REDUCE) {
    continue; // ignore setup/cleanup tasks
  }
  story.getTaskAttemptInfo(t, t.getAttempts().get(0));
}
Defensive patterns

Strategy: type-guard

Validate before calling

static boolean isSimulationTaskType(Values type) {
  return type == Values.MAP || type == Values.REDUCE;
}

Type guard

static boolean isSimulatableTask(LoggedTask t) {
  Values type = (t == null) ? null : t.getTaskType();
  return type == Values.MAP || type == Values.REDUCE;
}

Prevention

When it happens

Trigger: Calling getTaskAttemptInfo(...) (directly, or via getMapTaskAttemptInfoAdjusted()'s FAILED-attempt branch, or a JobStory's getTaskAttemptInfoAT/ATI) on a LoggedTask whose taskType is not MAP or REDUCE; traces containing setup/cleanup task records that reach the simulation path.

Common situations: Replaying rumen traces that include non-map/reduce tasks (job setup/cleanup) without filtering; custom schedulers/simulators that iterate every task in a LoggedJob instead of only map+reduce; traces where taskType is null due to damaged records.

Related errors


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