apache/hadoop · error · IOException

User is not set in the application report

Error message

User is not set in the application report

What it means

Thrown by ClientServiceDelegate while rebuilding a proxy for a running/finished application: the ApplicationReport fetched from the ResourceManager has a null user field. The job client requires the user (for proxy UGI, token ownership, and log paths) and fails fast with IOException instead of proceeding with incomplete identity. It usually indicates an inconsistent or partial report from the RM rather than a client bug.

Source

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

          LOG.info("Could not get Job info from RM for job " + jobId
              + ". Redirecting to job history server.");
          return checkAndGetHSProxy(null, JobState.RUNNING);
        }
      } catch (InterruptedException e) {
        LOG.warn("getProxy() call interrupted", e);
        throw new YarnRuntimeException(e);
      } catch (YarnException e) {
        throw new IOException(e);
      }
    }

    /** we just want to return if its allocating, so that we don't
     * block on it. This is to be able to return job status
     * on an allocating Application.
     */
    String user = application.getUser();
    if (user == null) {
      throw new IOException("User is not set in the application report");
    }
    if (application.getYarnApplicationState() == YarnApplicationState.NEW
        || application.getYarnApplicationState() ==
            YarnApplicationState.NEW_SAVING
        || application.getYarnApplicationState() == YarnApplicationState.SUBMITTED
        || application.getYarnApplicationState() == YarnApplicationState.ACCEPTED) {
      realProxy = null;
      return getNotRunningJob(application, JobState.NEW);
    }

    if (application.getYarnApplicationState() == YarnApplicationState.FAILED) {
      realProxy = null;
      return getNotRunningJob(application, JobState.FAILED);
    }

    if (application.getYarnApplicationState() == YarnApplicationState.KILLED) {
      realProxy = null;
      return getNotRunningJob(application, JobState.KILLED);

View on GitHub (pinned to 2add963021)

Solutions

  1. Retry the status call after a short delay — reports during RM transitions are often transiently incomplete
  2. Align client and cluster Hadoop versions (same hadoop-mapreduce-client-* artifacts)
  3. If persistent, inspect the application via yarn application -status <appId> to confirm the RM itself reports a user; if absent, the submission side is broken (fix the submitting client/job context user)

Example fix

// before
JobStatus s = jobClient.getJobStatus(jobId); // throws IOException: user null

// after
JobStatus s = retryWithBackoff(() -> jobClient.getJobStatus(jobId),
    /*attempts*/ 5, /*delayMs*/ 2000);
// transient RM reports resolve after failover completes; if not,
// check `yarn application -status` for the missing user field
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check the report the same way the delegate does
ApplicationReport rpt = yarnClient.getApplicationReport(appId);
if (rpt.getUser() == null)
  throw new IllegalStateException("RM returned incomplete report; retry shortly");

Try / catch

try {
  status = cluster.getJobStatus(jobId);
} catch (IOException e) {
  if (e.getMessage().contains("User is not set in the application report")) {
    Thread.sleep(2000); status = cluster.getJobStatus(jobId); // transient RM state
  } else throw e;
}

Prevention

When it happens

Trigger: ClusterClient/getJobStatus on a job whose ApplicationReport.getUser() returns null — seen when the RM returns a report for an application in an early/aborted state or from an RM version/upgrade mismatch where the field is unset. The check runs right after the report is obtained in the proxy-rebuild path, before the NEW/ACCEPTED state shortcuts.

Common situations: Querying job status during RM restart/failover while app state is being replayed; Version skew between job client and ResourceManager (older MR client against newer RM field semantics); Applications submitted through a non-standard client that did not set the submitter before RM persistence

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


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