apache/hadoop · error · IOException
Invalid @class value in NodePlan JSON: {textValue}
Error message
Invalid @class value in NodePlan JSON: {textValue} What it means
Error "Invalid @class value in NodePlan JSON: {textValue}" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/planner/NodePlan.java:198
*
* @param node a node representing the root of tree structure
* @throws IOException if any unexpected `@class` values are found - this is the
* pre-existing exception type exposed by the calling code
*/
private static void checkNodes(JsonNode node) throws IOException {
if (node == null) {
return;
}
// Check Node and Recurse into child nodes
if (node.isObject()) {
Iterator<Map.Entry<String, JsonNode>> fieldsIterator = node.fields();
while (fieldsIterator.hasNext()) {
Map.Entry<String, JsonNode> entry = fieldsIterator.next();
if ("@class".equals(entry.getKey())) {
String textValue = entry.getValue().asText();
if (textValue != null && !textValue.isBlank() && !stepClassIsAllowed(textValue)) {
throw new IOException("Invalid @class value in NodePlan JSON: " + textValue);
}
}
checkNodes(entry.getValue());
}
} else if (node.isArray()) {
for (int i = 0; i < node.size(); i++) {
checkNodes(node.get(i));
}
}
}
/**
* Returns a JSON representation of NodePlan.
*
* @return - JSON String
* @throws IOException
*/
public String toJson() throws IOException {View on GitHub (pinned to 2add963021)
Solutions
- Fix the @class field in the NodePlan JSON to a valid planner step class name.
- Regenerate the plan file with the diskbalancer tool instead of editing it by hand.
When it happens
Trigger: DiskBalancer plan parsing when the JSON @class field names a class that is not a known NodePlan implementation.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/90567d1f403cc576.
Report an issue: GitHub.