apache/hadoop · error · IOException

State transition not allowed; from {} to {}

Error message

State transition not allowed; from {} to {}

What it means

Error "State transition not allowed; from {} to {}" thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-blockgen/src/main/java/org/apache/hadoop/tools/dynamometer/blockgenerator/XMLParser.java:129

    }
    if (line.contains("</INodeSection>")) {
      transitionTo(State.DEFAULT);
    }
    return blockInfos;
  }

  /**
   * Attempt to transition to another state.
   *
   * @param nextState The new state to transition to.
   * @throws IOException If the transition from the current state to
   *                     {@code nextState} is not allowed.
   */
  private void transitionTo(State nextState) throws IOException {
    if (currentState.transitionAllowed(nextState)) {
      currentState = nextState;
    } else {
      throw new IOException("State transition not allowed; from " + currentState
          + " to " + nextState);
    }
  }

  /**
   * @param xml An XML string
   * @param field The field whose value(s) should be extracted
   * @return List of the field's values.
   */
  private static List<String> valuesFromXMLString(String xml, String field) {
    Matcher m = Pattern.compile("<" + field + ">(.+?)</" + field + ">")
        .matcher(xml);
    List<String> found = new ArrayList<>();
    while (m.find()) {
      found.add(m.group(1));
    }
    return found;
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Use an unmodified fsimage XML generated by hdfs oiv; the parser state machine rejected a transition because elements are out of order.

When it happens

Trigger: The XMLParser state machine receives a token that implies an illegal state transition, which happens when the input XML contains elements in an order the block generator does not expect.

Common situations: See trigger scenarios.


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