{"record":{"id":"b8274fc684ce3c35","repo":"apache/hadoop","slug":"can-t-find-the-queue-by-the-given-name-please-b8274f","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/SLSFairScheduler.java","lineNumber":100,"sourceCode":"  @Override\n  public Allocation allocatePropagated(ApplicationAttemptId attemptId,\n      List<ResourceRequest> resourceRequests,\n      List<SchedulingRequest> schedulingRequests,\n      List<ContainerId> containerIds, List<String> blacklistAdditions,\n      List<String> blacklistRemovals, ContainerUpdates updateRequests) {\n    return super.allocate(attemptId, resourceRequests, schedulingRequests,\n        containerIds, blacklistAdditions, blacklistRemovals, updateRequests);\n  }\n\n  @Override\n  public void serviceStop() throws Exception {\n    schedulerCommons.stopMetrics();\n    super.serviceStop();\n  }\n\n  public String getRealQueueName(String queue) throws YarnException {\n    if (!getQueueManager().exists(queue)) {\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 getQueueManager().getQueue(queue).getQueueName();\n  }\n\n  public SchedulerMetrics getSchedulerMetrics() {\n    return schedulerCommons.getSchedulerMetrics();\n  }\n\n  public Tracker getTracker() {\n    return schedulerCommons.getTracker();\n  }\n\n  @Override\n  public void setSLSRunner(SLSRunner runner) {\n    this.runner = runner;\n  }\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/scheduler/SLSFairScheduler.java#L82-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Declare the queue in fair-scheduler.xml (a <queue> element with matching name) and restart SLS","Match the \"queue\" string in the SLS input JSON exactly to the allocation-file queue name","Confirm the fair-scheduler.xml path in the SLS runner configuration is the file you edited","Diff the queue names used by the workload against queues listed in the allocation file before launching the simulation"],"exampleFix":"// before: fair-scheduler.xml only defines \"default\"\n// after: add the queue used by the workload\n<allocations>\n  <queue name=\"sample_queue\">\n    <minResources>1024 mb, 1 vcores</minResources>\n  </queue>\n</allocations>","handlingStrategy":"validation","validationCode":"// before SLS with fair scheduler: check queue existence the same way SLSFairScheduler does\nFairSchedulerEvents noop = null; // placeholder\n// simplest: parse fair-scheduler.xml <queue name=\"...\"> entries into a Set<String> configured,\n// then assert every \"queue\" value in the sls input json is in configured, else fail with the missing name.","typeGuard":null,"tryCatchPattern":"try { queuePath = slsFairScheduler.getRealQueueName(q); } catch (YarnException e) { /* e.getMessage() contains the queue name; fail fast */ }","preventionTips":["Declare every referenced queue in fair-scheduler.xml before starting the simulation","Keep allocation file and workload file under one change review so renames stay in sync","Use a preflight set-diff of queue names between the two files"],"tags":["hadoop-sls","fair-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"}