{"record":{"id":"146ecbe0cf66198e","repo":"apache/hadoop","slug":"malformed-xml-formation-queue-tag-and-acls-tags-o","errorCode":null,"errorMessage":" Malformed xml formation queue tag and acls tags or state tags are siblings ","messagePattern":" Malformed xml formation queue tag and acls tags or state tags are siblings ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueConfigurationParser.java","lineNumber":407,"sourceCode":"    Set<String> siblings = new HashSet<String>();\n    for (int i = 0; i < fields.getLength(); i++) {\n      if (!(fields.item(i) instanceof Element)) {\n        continue;\n      }\n      siblings.add((fields.item(i)).getNodeName());\n    }\n\n    if(! siblings.contains(QUEUE_NAME_TAG)) {\n      throw new RuntimeException(\n        \" Malformed xml formation queue name not specified \");\n    }\n\n    if (siblings.contains(QUEUE_TAG) && (\n      siblings.contains(ACL_ADMINISTER_JOB_TAG) ||\n        siblings.contains(ACL_SUBMIT_JOB_TAG) ||\n        siblings.contains(STATE_TAG)\n    )) {\n      throw new RuntimeException(\n        \" Malformed xml formation queue tag and acls \" +\n          \"tags or state tags are siblings \");\n    }\n  }\n\n\n  private static String getSimpleQueueName(String fullQName) {\n    int index = fullQName.lastIndexOf(NAME_SEPARATOR);\n    if (index < 0) {\n      return fullQName;\n    }\n    return fullQName.substring(index + 1, fullQName.length());\n  }\n\n  /**\n   * Construct an {@link Element} for a single queue, constructing the inner\n   * queue &lt;name/&gt;, &lt;properties/&gt;, &lt;state/&gt; and the inner\n   * &lt;queue&gt; elements recursively.","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueConfigurationParser.java#L389-L425","documentation":"QueueConfigurationParser validates mapred-queues.xml while building the queue hierarchy. A <queue> element that contains nested <queue> children (a parent queue) must not also carry <acl-submit-job>, <acl-administer-jobs>, or <state> tags as direct siblings; those properties are only legal on leaf queues. When both are present the parser throws this RuntimeException, which fails QueueManager initialization and typically prevents JobTracker startup or a queue refresh.","triggerScenarios":"mapred-queues.xml contains a parent queue like <queue><name>a</name><state>running</state><queue><name>a1</name>...</queue></queue>. Loading it via new QueueConfigurationParser(...) or any code path that builds a QueueManager (JobTracker start, refresh-queues) throws.","commonSituations":"Migrating from a flat queue list to a hierarchical one by copying a leaf-queue template into a parent element; hand-editing mapred-queues.xml without knowing that ACL/state tags are leaf-only; merging queue configs from different clusters.","solutions":["Remove <state>, <acl-submit-job>, and <acl-administer-jobs> from every parent <queue> element that nests <queue> children; keep only <name> and the nested queues there.","Move the ACL and state settings down to the leaf queues that actually accept jobs.","Re-check the whole file for the same pattern in other parents before restarting, since parsing stops at the first bad queue.","Restart the JobTracker (or re-run the config load) to confirm the file parses cleanly."],"exampleFix":"<!-- before -->\n<queue>\n  <name>eng</name>\n  <state>running</state>\n  <queue>\n    <name>eng-etl</name>\n  </queue>\n</queue>\n\n<!-- after -->\n<queue>\n  <name>eng</name>\n  <queue>\n    <name>eng-etl</name>\n    <state>running</state>\n  </queue>\n</queue>","handlingStrategy":"validation","validationCode":"// before deploying mapred-queues.xml: parent queues must not carry acl/state tags\nDocument doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(confDir, \"mapred-queues.xml\"));\nNodeList queues = doc.getElementsByTagName(\"queue\");\nfor (int i = 0; i < queues.getLength(); i++) {\n  Element q = (Element) queues.item(i);\n  boolean hasChildren = q.getElementsByTagName(\"queue\").getLength() > 0;\n  if (hasChildren) {\n    for (String bad : new String[]{\"state\", \"acl-submit-job\", \"acl-administer-jobs\"}) {\n      if (q.getElementsByTagName(bad).getLength() > 0)\n        throw new IllegalStateException(\"Parent queue \" + q.getElementsByTagName(\"name\").item(0).getTextContent()\n            + \" must not contain <\" + bad + \">; move it to leaf queues\");\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a leaf-queue template and a parent-queue template; parents contain only <name> and nested <queue>.","Lint mapred-queues.xml in CI with the DOM check above before pushing to config management.","Document that ACL and state tags are legal only on leaf queues."],"tags":["hadoop","mapreduce","queue-configuration","xml","config"],"backgroundTag":"xml-config-validation-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}