apache/hadoop · error · YarnException

Can't find the queue by the given name: {}! Please check if

Error message

Can't find the queue by the given name: {}! Please check if queue {} is in the allocation file.

What it means

Fair-scheduler counterpart of the SLS queue check: SLSFairScheduler.getRealQueueName() calls getQueueManager().exists(queue); if the FairScheduler queue manager has no such queue (i.e. it is not in the fair-scheduler.xml allocation file), it throws YarnException with the queue name embedded in the message.

Source

Thrown at hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSFairScheduler.java:100

  @Override
  public Allocation allocatePropagated(ApplicationAttemptId attemptId,
      List<ResourceRequest> resourceRequests,
      List<SchedulingRequest> schedulingRequests,
      List<ContainerId> containerIds, List<String> blacklistAdditions,
      List<String> blacklistRemovals, ContainerUpdates updateRequests) {
    return super.allocate(attemptId, resourceRequests, schedulingRequests,
        containerIds, blacklistAdditions, blacklistRemovals, updateRequests);
  }

  @Override
  public void serviceStop() throws Exception {
    schedulerCommons.stopMetrics();
    super.serviceStop();
  }

  public String getRealQueueName(String queue) throws YarnException {
    if (!getQueueManager().exists(queue)) {
      throw new YarnException("Can't find the queue by the given name: " + queue
          + "! Please check if queue " + queue + " is in the allocation file.");
    }
    return getQueueManager().getQueue(queue).getQueueName();
  }

  public SchedulerMetrics getSchedulerMetrics() {
    return schedulerCommons.getSchedulerMetrics();
  }

  public Tracker getTracker() {
    return schedulerCommons.getTracker();
  }

  @Override
  public void setSLSRunner(SLSRunner runner) {
    this.runner = runner;
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Declare the queue in fair-scheduler.xml (a <queue> element with matching name) and restart SLS
  2. Match the "queue" string in the SLS input JSON exactly to the allocation-file queue name
  3. Confirm the fair-scheduler.xml path in the SLS runner configuration is the file you edited
  4. Diff the queue names used by the workload against queues listed in the allocation file before launching the simulation

Example fix

// before: fair-scheduler.xml only defines "default"
// after: add the queue used by the workload
<allocations>
  <queue name="sample_queue">
    <minResources>1024 mb, 1 vcores</minResources>
  </queue>
</allocations>
Defensive patterns

Strategy: validation

Validate before calling

// before SLS with fair scheduler: check queue existence the same way SLSFairScheduler does
FairSchedulerEvents noop = null; // placeholder
// simplest: parse fair-scheduler.xml <queue name="..."> entries into a Set<String> configured,
// then assert every "queue" value in the sls input json is in configured, else fail with the missing name.

Try / catch

try { queuePath = slsFairScheduler.getRealQueueName(q); } catch (YarnException e) { /* e.getMessage() contains the queue name; fail fast */ }

Prevention

When it happens

Trigger: Running SLS with SLSFairScheduler (e.g. -Dyarn.sls.scheduler.policy=... / fair scheduler runner) where the "queue" value in the workload JSON does not exist in the fair-scheduler.xml allocation file loaded by the simulator.

Common situations: Queue names in the workload file out of sync with fair-scheduler.xml after edits, relying on implicitly-created queues that fair scheduler only creates when the allocation file declares them (or when auto-queue-creation is enabled on the real cluster but not in the SLS config), quoting/whitespace differences in queue names.

Related errors


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