apache/hadoop · error · SAXException

Invalid XML

Error message

Invalid XML

What it means

Error "Invalid XML" thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/contracts/services/ContainerListXmlParser.java:106

  /**
   * SAX handler implementation for parsing container list responses.
   * <p>
   * This method is invoked at the end of every XML element encountered
   * during SAX parsing. It validates element structure and delegates
   * processing to appropriate helper methods depending on whether the
   * element belongs to a container, container properties, metadata,
   * or top-level response fields.
   */
  @Override
  public void endElement(
      final String uri,
      final String localName,
      final String qName) throws SAXException {

    final String currentNode = elements.pop();
    // Validate XML structure
    if (!currentNode.equals(localName)) {
      throw new SAXException(AbfsHttpConstants.XML_TAG_INVALID_XML);
    }
    final String parentNode =
        elements.isEmpty() ? EMPTY_STRING : elements.peek();
    final String value = getTrimmedValue();
    // Handle container-related nodes
    if (currentContainer != null) {
      handleContainerNode(currentNode, parentNode, value);
    } else {
      // Handle response-level nodes
      handleResponseNode(currentNode, value);
    }
    // Reset character buffer
    buffer = new StringBuilder();
  }

  /**
   * Returns the trimmed character buffer value.
   *

View on GitHub (pinned to 2add963021)

Solutions

  1. Verify the container listing response is well-formed XML by capturing the raw payload with DEBUG logging.
  2. Remove intermediary proxies that may modify the response.
  3. Retry the listing operation.

When it happens

Trigger: Listing containers over the Blob endpoint returns malformed XML from the service or a tampering intermediary.

Common situations: See trigger scenarios.


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