apache/hadoop · error · RuntimeException

No queues defined

Error message

No queues defined 

What it means

After parsing, the queue XML parser requires the document's root element to be exactly <queues>; anything else triggers this RuntimeException immediately after the 'Bad conf file: top-level element not <queues>' log line. It means the wrong file or a malformed document reached the queue parser.

Source

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

        "Failed to set setXIncludeAware(true) for parser "
          + docBuilderFactory
          + NAME_SEPARATOR + e);
    }
    DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
    Document doc = null;
    Element queuesNode = null;

    doc = builder.parse(resourceInput);
    queuesNode = doc.getDocumentElement();
    return this.parseResource(queuesNode);
  }

  private Queue parseResource(Element queuesNode) {
    Queue rootNode = null;
    try {
      if (!QUEUES_TAG.equals(queuesNode.getTagName())) {
        LOG.info("Bad conf file: top-level element not <queues>");
        throw new RuntimeException("No queues defined ");
      }
      NamedNodeMap nmp = queuesNode.getAttributes();
      Node acls = nmp.getNamedItem(ACLS_ENABLED_TAG);

      if (acls != null) {
        LOG.warn("Configuring " + ACLS_ENABLED_TAG + " flag in " +
            QueueManager.QUEUE_CONF_FILE_NAME + " is not valid. " +
            "This tag is ignored. Configure " +
            MRConfig.MR_ACLS_ENABLED + " in mapred-site.xml. See the " +
            " documentation of " + MRConfig.MR_ACLS_ENABLED +
            ", which is used for enabling job level authorization and " +
            " queue level authorization.");
      }

      NodeList props = queuesNode.getChildNodes();
      if (props == null || props.getLength() <= 0) {
        LOG.info(" Bad configuration no queues defined ");
        throw new RuntimeException(" No queues defined ");

View on GitHub (pinned to 2add963021)

Solutions

  1. Make the root element exactly <queues>
  2. Diff against a known-good mapred-queues.xml from the Hadoop distribution
  3. Validate before deploying: xmllint --noout mapred-queues.xml plus an explicit root-element check

Example fix

<!-- before -->
<configuration>
  <queue><name>default</name></queue>
</configuration>

<!-- after -->
<queues>
  <queue><name>default</name></queue>
</queues>
Defensive patterns

Strategy: validation

Validate before calling

// deploy-time check: queue config root must be <queues>
Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(path));
if (!"queues".equals(d.getDocumentElement().getTagName())) {
  throw new IllegalArgumentException("queue config root must be <queues>, found <"
      + d.getDocumentElement().getTagName() + ">");
}

Prevention

When it happens

Trigger: A mapred-queues.xml whose root is <configuration> (mapred-site content pasted in), a typo'd or differently-cased root tag, or an unrelated XML file passed to QueueConfigurationParser.

Common situations: Copy-paste between config files during cluster setup; template refactors renaming the root; editor auto-modifications; CI deploying the wrong template into mapred-queues.xml.

Related errors


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