apache/hadoop · error · RuntimeException

Malformed xml formation queue name not specified

Error message

 Malformed xml formation queue name not specified 

What it means

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.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueConfigurationParser.java:398

   *  throws an Exception.
   * @param node
   */
  private void validate(Node node) {

    NodeList fields = node.getChildNodes();

    //Check if <queue> & (<acls-*> || <state>) are not siblings
    //if yes throw an IOException.
    Set<String> siblings = new HashSet<String>();
    for (int i = 0; i < fields.getLength(); i++) {
      if (!(fields.item(i) instanceof Element)) {
        continue;
      }
      siblings.add((fields.item(i)).getNodeName());
    }

    if(! siblings.contains(QUEUE_NAME_TAG)) {
      throw new RuntimeException(
        " Malformed xml formation queue name not specified ");
    }

    if (siblings.contains(QUEUE_TAG) && (
      siblings.contains(ACL_ADMINISTER_JOB_TAG) ||
        siblings.contains(ACL_SUBMIT_JOB_TAG) ||
        siblings.contains(STATE_TAG)
    )) {
      throw new RuntimeException(
        " Malformed xml formation queue tag and acls " +
          "tags or state tags are siblings ");
    }
  }


  private static String getSimpleQueueName(String fullQName) {
    int index = fullQName.lastIndexOf(NAME_SEPARATOR);
    if (index < 0) {

View on GitHub (pinned to 2add963021)

Solutions

  1. Add <name>...</name> as a child of every <queue>
  2. If configs are generated, make the name field required and fail generation when unset
  3. Lint with XPath before deploying: every /queues/queue must contain a non-empty name

Example fix

<!-- before -->
<queue>
  <state>running</state>
</queue>

<!-- after -->
<queue>
  <name>etl</name>
  <state>running</state>
</queue>
Defensive patterns

Strategy: validation

Validate before calling

// XPath check before deploying the file: every queue must have a non-empty name
NodeList queues = (NodeList) xpath.evaluate("/queues/queue", doc, XPathConstants.NODESET);
for (int i = 0; i < queues.getLength(); i++) {
  String n = (String) xpath.evaluate("name/text()", queues.item(i), XPathConstants.STRING);
  if (n == null || n.trim().isEmpty())
    throw new IllegalArgumentException("queue #" + i + " has no <name>");
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/80f67d7d4573115d. Report an issue: GitHub.