{"record":{"id":"80f67d7d4573115d","repo":"apache/hadoop","slug":"malformed-xml-formation-queue-name-not-specified","errorCode":null,"errorMessage":" Malformed xml formation queue name not specified ","messagePattern":" Malformed xml formation queue name not specified ","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":398,"sourceCode":"   *  throws an Exception.\n   * @param node\n   */\n  private void validate(Node node) {\n\n    NodeList fields = node.getChildNodes();\n\n    //Check if <queue> & (<acls-*> || <state>) are not siblings\n    //if yes throw an IOException.\n    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) {","sourceCodeStart":380,"sourceCodeEnd":416,"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#L380-L416","documentation":"For every <queue> element the parser collects the tag names of its element children (siblings such as <name>, <state>, <acls-submit-job>) and requires <name> among them; if absent, this RuntimeException is thrown (the message has a leading space). A queue without a name cannot be registered, so parsing aborts.","triggerScenarios":"A <queue> element whose children are only <state>/<acls-*>/<properties> tags - the <name> child was deleted or never emitted; commonly produced by templating loops that render ACLs but skip a missing name field.","commonSituations":"Hand-edited queue XML dropping the mandatory name; generated configs with an unset required field; merging ACL snippets into a queue element without bringing <name> along.","solutions":["Add <name>...</name> as a child of every <queue>","If configs are generated, make the name field required and fail generation when unset","Lint with XPath before deploying: every /queues/queue must contain a non-empty name"],"exampleFix":"<!-- before -->\n<queue>\n  <state>running</state>\n</queue>\n\n<!-- after -->\n<queue>\n  <name>etl</name>\n  <state>running</state>\n</queue>","handlingStrategy":"validation","validationCode":"// XPath check before deploying the file: every queue must have a non-empty name\nNodeList queues = (NodeList) xpath.evaluate(\"/queues/queue\", doc, XPathConstants.NODESET);\nfor (int i = 0; i < queues.getLength(); i++) {\n  String n = (String) xpath.evaluate(\"name/text()\", queues.item(i), XPathConstants.STRING);\n  if (n == null || n.trim().isEmpty())\n    throw new IllegalArgumentException(\"queue #\" + i + \" has no <name>\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat <name> as a required field in every queue template","Lint queue XML with XPath presence checks for /queues/queue/name in CI","Fail config generation early when a required field like queue name is unset"],"tags":["hadoop","mapreduce","queues","xml","missing-field","configuration"],"backgroundTag":"malformed-config-file","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}