{"record":{"id":"89315371c2f20e71","repo":"apache/hadoop","slug":"state-transition-not-allowed-from-to","errorCode":null,"errorMessage":"State transition not allowed; from {} to {}","messagePattern":"State transition not allowed; from (.+?) to (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-blockgen/src/main/java/org/apache/hadoop/tools/dynamometer/blockgenerator/XMLParser.java","lineNumber":129,"sourceCode":"    }\n    if (line.contains(\"</INodeSection>\")) {\n      transitionTo(State.DEFAULT);\n    }\n    return blockInfos;\n  }\n\n  /**\n   * Attempt to transition to another state.\n   *\n   * @param nextState The new state to transition to.\n   * @throws IOException If the transition from the current state to\n   *                     {@code nextState} is not allowed.\n   */\n  private void transitionTo(State nextState) throws IOException {\n    if (currentState.transitionAllowed(nextState)) {\n      currentState = nextState;\n    } else {\n      throw new IOException(\"State transition not allowed; from \" + currentState\n          + \" to \" + nextState);\n    }\n  }\n\n  /**\n   * @param xml An XML string\n   * @param field The field whose value(s) should be extracted\n   * @return List of the field's values.\n   */\n  private static List<String> valuesFromXMLString(String xml, String field) {\n    Matcher m = Pattern.compile(\"<\" + field + \">(.+?)</\" + field + \">\")\n        .matcher(xml);\n    List<String> found = new ArrayList<>();\n    while (m.find()) {\n      found.add(m.group(1));\n    }\n    return found;\n  }","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-blockgen/src/main/java/org/apache/hadoop/tools/dynamometer/blockgenerator/XMLParser.java#L111-L147","documentation":"Error \"State transition not allowed; from {} to {}\" thrown in apache/hadoop.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Use an unmodified fsimage XML generated by hdfs oiv; the parser state machine rejected a transition because elements are out of order."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}