apache/hadoop · error · IllegalArgumentException
Not a valid Boolean value for {property} in reconfSlowPeerPa
Error message
Not a valid Boolean value for {property} in reconfSlowPeerParameters What it means
DataNode.reconfSlowPeerParameters applies live reconfigurations for slow-peer metrics; for dfs.datanode.peer.stats.enabled it accepts only the literal strings "true" or "false" (case-insensitive). Any other non-null value raises IllegalArgumentException('Not a valid Boolean value for ...'), which the method wraps into a ReconfigurationException naming the property, the old value, and the new value. The DataNode keeps running with the previous setting.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:870
dnConf.setInitBRDelayMs(result);
}
LOG.info("RECONFIGURE* changed {} to {}", property, newVal);
return result;
} catch (IllegalArgumentException e) {
throw new ReconfigurationException(property, newVal, getConf().get(property), e);
}
}
private String reconfSlowPeerParameters(String property, String newVal)
throws ReconfigurationException {
String result = null;
try {
LOG.info("Reconfiguring {} to {}", property, newVal);
if (property.equals(DFS_DATANODE_PEER_STATS_ENABLED_KEY)) {
Preconditions.checkNotNull(dnConf, "DNConf has not been initialized.");
if (newVal != null && !newVal.equalsIgnoreCase("true")
&& !newVal.equalsIgnoreCase("false")) {
throw new IllegalArgumentException("Not a valid Boolean value for " + property +
" in reconfSlowPeerParameters");
}
boolean enable = (newVal == null ? DFS_DATANODE_PEER_STATS_ENABLED_DEFAULT :
Boolean.parseBoolean(newVal));
result = Boolean.toString(enable);
dnConf.setPeerStatsEnabled(enable);
if (enable) {
// Create if it doesn't exist, overwrite if it does.
peerMetrics = DataNodePeerMetrics.create(getDisplayName(), getConf());
}
} else if (property.equals(DFS_DATANODE_MIN_OUTLIER_DETECTION_NODES_KEY)) {
Preconditions.checkNotNull(peerMetrics, "DataNode peer stats may be disabled.");
long minNodes = (newVal == null ? DFS_DATANODE_MIN_OUTLIER_DETECTION_NODES_DEFAULT :
Long.parseLong(newVal));
result = Long.toString(minNodes);
peerMetrics.setMinOutlierDetectionNodes(minNodes);
} else if (property.equals(DFS_DATANODE_SLOWPEER_LOW_THRESHOLD_MS_KEY)) {
Preconditions.checkNotNull(peerMetrics, "DataNode peer stats may be disabled.");View on GitHub (pinned to 2add963021)
Solutions
- Resubmit with the literal true or false: hdfs dfsadmin -reconfig datanode <dnHost:ipcPort> start <nnUri> dfs.datanode.peer.stats.enabled=true
- Fix the upstream template or config-management source so it emits only true or false (no 1/0, no whitespace, no units)
- Confirm the DN retained the old value and is healthy: hdfs dfsadmin -reconfig datanode <dnHost:ipcPort> status
Example fix
// before $ hdfs dfsadmin -reconfig datanode dn1:9867 start hdfs://nn1:8020 dfs.datanode.peer.stats.enabled=yes // => ReconfigurationException: Could not change property ... Not a valid Boolean value for dfs.datanode.peer.stats.enabled ... // after $ hdfs dfsadmin -reconfig datanode dn1:9867 start hdfs://nn1:8020 dfs.datanode.peer.stats.enabled=true
Defensive patterns
Strategy: validation
Validate before calling
static boolean isDnBooleanLiteral(String v) {
return v == null || v.equalsIgnoreCase("true") || v.equalsIgnoreCase("false");
}
// gate before submitting the reconfiguration
if (!isDnBooleanLiteral(newVal)) {
throw new IllegalArgumentException("dfs.datanode.peer.stats.enabled accepts only true/false, got: " + newVal);
} Try / catch
try {
dn.reconfigurePropertyImpl(DFS_DATANODE_PEER_STATS_ENABLED_KEY, newVal);
} catch (ReconfigurationException e) {
// message carries property + oldVal + newVal; cause is the IllegalArgumentException
LOG.warn("Reconfig rejected: {}", e.getMessage(), e.getCause());
} Prevention
- Use only the literals true/false for DataNode boolean reconfigs; 1/0/yes/on are rejected
- Render booleans in config templates through a whitelist, never raw integers or nullable strings
- Run 'dfsadmin -reconfig ... status' after every change to confirm it applied
When it happens
Trigger: Calling DataNode.reconfigureProperty (via 'hdfs dfsadmin -reconfig datanode <dn:ipc> start', the Reconfiguration JMX bean, or the HTTP reconfig servlet) for dfs.datanode.peer.stats.enabled with values like "1", "yes", "on", "enabled", an empty string, " true" with leading/trailing whitespace, or an unexpanded template placeholder. A null newVal is accepted and resets to DFS_DATANODE_PEER_STATS_ENABLED_DEFAULT.
Common situations: Enabling slow-peer metrics on a live cluster using yes/no style booleans from internal wikis; Ambari/Cloudera Manager/Ansible templates that render booleans as 1/0 or pad whitespace; scripts that reuse client-side key names in datanode reconfig payloads.
Related errors
- Not a valid Boolean value for {property}
- No directory is specified.
- FsDatasetSpi has not been initialized
- Changing storage type is not allowed.
- Attempt to remove all volumes.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/b4fea0809861b51b.
Report an issue: GitHub.