{"record":{"id":"e81b912eaaf943c3","repo":"apache/hadoop","slug":"can-t-find-the-queue-by-the-given-name-please","errorCode":null,"errorMessage":"Can't find the queue by the given name: {}! Please check if queue {} is in the allocation file.","messagePattern":"Can't find the queue by the given name: (.+?)! Please check if queue (.+?) is in the allocation file\\.","errorType":"exception","errorClass":"YarnException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java","lineNumber":133,"sourceCode":"      throw e;\n    }\n  }\n\n  @Override\n  public void propagatedHandle(SchedulerEvent schedulerEvent) {\n    super.handle(schedulerEvent);\n  }\n\n  @Override\n  public void serviceStop() throws Exception {\n    schedulerCommons.stopMetrics();\n    super.serviceStop();\n  }\n\n\n  public String getRealQueueName(String queue) throws YarnException {\n    if (getQueue(queue) == null) {\n      throw new YarnException(\"Can't find the queue by the given name: \" + queue\n          + \"! Please check if queue \" + queue + \" is in the allocation file.\");\n    }\n    return getQueue(queue).getQueuePath();\n  }\n\n  public SchedulerMetrics getSchedulerMetrics() {\n    return schedulerCommons.getSchedulerMetrics();\n  }\n\n  @Override\n  public Configuration getConf() {\n    return conf;\n  }\n\n  public Tracker getTracker() {\n    return schedulerCommons.getTracker();\n  }\n","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSCapacityScheduler.java#L115-L151","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before: sls input uses queue \"etl\" but allocation has root.default and root.prod\n// capacity-scheduler.xml\n<queue name=\"prod\">\n  <capacity>50</capacity>\n</queue>\n// after: add the queue and keep names in sync\n<queue name=\"etl\">\n  <capacity>50</capacity>\n  <maximum-capacity>100</maximum-capacity>\n</queue>","handlingStrategy":"validation","validationCode":"// before SLSRunner start: parse capacity-scheduler.xml and diff against workload queues\nSet<String> configured = new HashSet<>();\nDocument xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(\"capacity-scheduler.xml\"));\nNodeList qs = xml.getElementsByTagName(\"queue\");\nfor (int i = 0; i < qs.getLength(); i++) configured.add(qs.item(i).getAttributes().getNamedItem(\"name\").getNodeValue());\nSet<String> used = /* read \"queue\" fields from sls input json */;\nused.removeAll(configured);\nif (!used.isEmpty()) throw new IllegalStateException(\"Queues missing from allocation file: \" + used);","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["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"],"tags":["hadoop-sls","capacity-scheduler","queue-config","yarn","configuration"],"backgroundTag":"queue-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}