apache/hadoop · error · IllegalArgumentException
{} is not boolean value
Error message
{} is not boolean value What it means
The DFS_NAMENODE_LOCK_DETAILED_METRICS_KEY case of reconfigureFSNamesystemLockMetricsParameters requires dfs.namenode.lock.detailed-metrics.enabled to be null (reset to default) or case-insensitively 'true'/'false'; anything else throws IllegalArgumentException('<newVal> is not boolean value'), which the surrounding catch then wraps into a ReconfigurationException for the caller.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java:2781
try {
int newSetting = adjustNewVal(
DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_DEFAULT, newValue);
namesystem.getBlockManager().setMinBlocksForWrite(newSetting);
return String.valueOf(newSetting);
} catch (IllegalArgumentException e) {
throw new ReconfigurationException(property, newValue, getConf().get(property), e);
}
}
private String reconfigureFSNamesystemLockMetricsParameters(final String property,
final String newVal) throws ReconfigurationException {
String result;
try {
switch (property) {
case DFS_NAMENODE_LOCK_DETAILED_METRICS_KEY: {
if (newVal != null && !newVal.equalsIgnoreCase("true") &&
!newVal.equalsIgnoreCase("false")) {
throw new IllegalArgumentException(newVal + " is not boolean value");
}
boolean enable = (newVal == null ?
DFS_NAMENODE_LOCK_DETAILED_METRICS_DEFAULT : Boolean.parseBoolean(newVal));
result = Boolean.toString(enable);
namesystem.setMetricsEnabled(enable);
break;
}
case DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_KEY: {
long readLockReportingThresholdMs = (newVal == null ?
DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_DEFAULT : Long.parseLong(newVal));
result = Long.toString(readLockReportingThresholdMs);
namesystem.setReadLockReportingThresholdMs(readLockReportingThresholdMs);
break;
}
case DFS_NAMENODE_WRITE_LOCK_REPORTING_THRESHOLD_MS_KEY: {
long writeLockReportingThresholdMs = (newVal == null ?
DFS_NAMENODE_WRITE_LOCK_REPORTING_THRESHOLD_MS_DEFAULT : Long.parseLong(newVal));
result = Long.toString(writeLockReportingThresholdMs);View on GitHub (pinned to 2add963021)
Solutions
- Use exactly true or false (case-insensitive, no whitespace): `-set dfs.namenode.lock.detailed-metrics.enabled=true`
- Trim and validate variables in automation before sending
- Pair it with the threshold keys (read/write lock reporting threshold-ms), which must be plain longs
- After enabling, watch the new FSNamesystem lock metrics via the NN JMX
Example fix
# before hdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.namenode.lock.detailed-metrics.enabled=1 # after hdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.namenode.lock.detailed-metrics.enabled=true
Defensive patterns
Strategy: validation
Validate before calling
V=$(echo "$LOCK_METRICS" | tr -d '[:space:]')
case "${V,,}" in true|false) ;; *) echo "need true|false"; exit 1;; esac
hdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.namenode.lock.detailed-metrics.enabled=$V Type guard
static boolean isBooleanLiteral(String s) {
return "true".equalsIgnoreCase(s) || "false".equalsIgnoreCase(s);
} Try / catch
catch (ReconfigurationException e) {
if (e.getCause() instanceof IllegalArgumentException
&& e.getCause().getMessage().contains("not boolean")) {
// retry with exactly true/false
}
} Prevention
- Trim whitespace before sending boolean reconfig values
- Ban 'yes/on/1/0' spellings in your team's reconfig helper
- Group-apply lock-metrics keys and validate all values up front
When it happens
Trigger: `hdfs dfsadmin -reconfig namenode <addr> -set dfs.namenode.lock.detailed-metrics.enabled=<not true/false>` - e.g. 'yes', '1', 'enable', 'TRUE ' with whitespace.
Common situations: Enabling detailed NameNode lock metrics for latency debugging with loose boolean spellings; config management writing 'True ' with a trailing space.
Related errors
- Could not change property {property} from '{oldVal}' to '{ne
- For enabling or disabling storage policy satisfier, must pas
- Could not change property {} from '{}' to '{}'
- Enabling or disabling storage policy satisfier service on {s
- The log file {} seems to contain valid transactions ; journa
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/6021031844592fd9.
Report an issue: GitHub.