apache/hadoop · error · IOException

Malformed LiveNodes JSON; got token =

Error message

Malformed LiveNodes JSON; got token = %s; currentNodeAddr = %s: %s

What it means

Dynamometer utility parse failure: while tokenizing the NameNode's LiveNodes JMX JSON to find stale DataNodes, the stream did not match the expected structure at the given token/current node address; the raw values are included for diagnosis.

Solutions

  1. Verify the NameNode JMX/LiveNodes endpoint returns well-formed JSON; an upgrade or proxy may have altered the response format.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: The LiveNodes JSON returned by the NameNode JMX endpoint cannot be parsed into the expected structure, e.g. because the token order or format changed or the endpoint returned an error page.

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

Thrown at hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/DynoInfraUtils.java:508

    int objectDepth = 0;
    String currentNodeAddr = null;
    for (JsonToken tok = parser.nextToken(); tok != null; tok = parser
        .nextToken()) {
      if (tok == JsonToken.START_OBJECT) {
        objectDepth++;
      } else if (tok == JsonToken.END_OBJECT) {
        objectDepth--;
      } else if (tok == JsonToken.FIELD_NAME) {
        if (objectDepth == 1) {
          // This is where the Datanode identifiers are stored
          currentNodeAddr = parser.getCurrentName();
        } else if (objectDepth == 2) {
          if (parser.getCurrentName().equals("numBlocks")) {
            JsonToken valueToken = parser.nextToken();
            if (valueToken != JsonToken.VALUE_NUMBER_INT
                || currentNodeAddr == null) {
              throw new IOException(String.format("Malformed LiveNodes JSON; "
                      + "got token = %s; currentNodeAddr = %s: %s",
                  valueToken, currentNodeAddr, liveNodeJsonString));
            }
            int numBlocks = parser.getIntValue();
            if (numBlocks < blockThreshold) {
              log.debug(String.format(
                  "Queueing Datanode <%s> for block report; numBlocks = %d",
                  currentNodeAddr, numBlocks));
              dataNodesToReport.add(currentNodeAddr);
            } else {
              log.debug(String.format(
                  "Not queueing Datanode <%s> for block report; numBlocks = %d",
                  currentNodeAddr, numBlocks));
            }
          }
        }
      }
    }

View on GitHub (pinned to 2add963021)