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
Thrown by SLSCapacityScheduler.getRealQueueName() when the SLS workload references a queue that getQueue(queue) cannot find, meaning no queue with that name exists in the loaded capacity-scheduler.xml configuration. SLS refuses to continue because it cannot map the simulated application to a real queue path.
Source
Thrown at hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java:133
throw e;
}
}
@Override
public void propagatedHandle(SchedulerEvent schedulerEvent) {
super.handle(schedulerEvent);
}
@Override
public void serviceStop() throws Exception {
schedulerCommons.stopMetrics();
super.serviceStop();
}
public String getRealQueueName(String queue) throws YarnException {
if (getQueue(queue) == null) {
throw new YarnException("Can't find the queue by the given name: " + queue
+ "! Please check if queue " + queue + " is in the allocation file.");
}
return getQueue(queue).getQueuePath();
}
public SchedulerMetrics getSchedulerMetrics() {
return schedulerCommons.getSchedulerMetrics();
}
@Override
public Configuration getConf() {
return conf;
}
public Tracker getTracker() {
return schedulerCommons.getTracker();
}
View on GitHub (pinned to 2add963021)
Solutions
- Add the missing queue to capacity-scheduler.xml with valid capacity so it is initialized at scheduler startup
- Use the exact queue name as configured (leaf queue name as CapacityScheduler sees it) in the "queue" field of every app in the SLS input JSON
- Verify the SLS runner config actually loads the capacity-scheduler.xml you edited (check startup logs for parsed queues)
- Cross-check queue names mechanically: list queues from the XML and diff against the set used in the workload file
Example fix
// before: sls input uses queue "etl" but allocation has root.default and root.prod // capacity-scheduler.xml <queue name="prod"> <capacity>50</capacity> </queue> // after: add the queue and keep names in sync <queue name="etl"> <capacity>50</capacity> <maximum-capacity>100</maximum-capacity> </queue>
Defensive patterns
Strategy: validation
Validate before calling
// before SLSRunner start: parse capacity-scheduler.xml and diff against workload queues
Set<String> configured = new HashSet<>();
Document xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File("capacity-scheduler.xml"));
NodeList qs = xml.getElementsByTagName("queue");
for (int i = 0; i < qs.getLength(); i++) configured.add(qs.item(i).getAttributes().getNamedItem("name").getNodeValue());
Set<String> used = /* read "queue" fields from sls input json */;
used.removeAll(configured);
if (!used.isEmpty()) throw new IllegalStateException("Queues missing from allocation file: " + used); Try / catch
wrap scheduler init/first getRealQueueName calls in try { ... } catch (YarnException e) { log e.getMessage(); } — the message already names the missing queue; fail fast with a config-fix hint. Prevention
- Generate the workload's queue list from the allocation file itself, or vice versa
- Run a name-diff between workload queues and scheduler config as a preflight step
- Prefer leaf queue names exactly as declared in capacity-scheduler.xml
When it happens
Trigger: Running SLSRunner with a capacity-scheduler setup where an app/task in the input JSON has a "queue" field that does not match any queue in the capacity-scheduler.xml pointed to by the SLS runner configuration (e.g. yarn.sls.scheduler.capacity.node-config / scheduler XML path).
Common situations: Using a fully-qualified path ('root.prod') where only the leaf name ('prod') is configured (or vice versa), queues renamed in capacity-scheduler.xml but not in the workload file, the wrong allocation file picked up because the SLS config points elsewhere, or a new queue added to the workload but never given capacity in the XML.
Related errors
- Can't find the queue by the given name: {}! Please check if
- Duration of a task shouldn't be less or equal to 0!
- ${diskValidator} DiskValidator class not found.
- dir + " is not a directory!"
- "Not creating intermediate history logDir: [" + doneDirPath
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/e81b912eaaf943c3.
Report an issue: GitHub.