apache/hadoop · error · RuntimeException
Inconsistent configuration of block access tokens. Either al
Error message
Inconsistent configuration of block access tokens. Either all block pools must be configured to use block tokens, or none may be.
What it means
Error "Inconsistent configuration of block access tokens. Either all block pools must be configured to use block tokens, or none may be." thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:2123
}
registerBlockPoolWithSecretManager(bpRegistration, blockPoolId);
}
/**
* After the block pool has contacted the NN, registers that block pool
* with the secret manager, updating it with the secrets provided by the NN.
* @throws IOException on error
*/
private synchronized void registerBlockPoolWithSecretManager(
DatanodeRegistration bpRegistration, String blockPoolId) throws IOException {
ExportedBlockKeys keys = bpRegistration.getExportedKeys();
if (!hasAnyBlockPoolRegistered) {
hasAnyBlockPoolRegistered = true;
isBlockTokenEnabled = keys.isBlockTokenEnabled();
} else {
if (isBlockTokenEnabled != keys.isBlockTokenEnabled()) {
throw new RuntimeException("Inconsistent configuration of block access"
+ " tokens. Either all block pools must be configured to use block"
+ " tokens, or none may be.");
}
}
if (!isBlockTokenEnabled) return;
if (!blockPoolTokenSecretManager.isBlockPoolRegistered(blockPoolId)) {
long blockKeyUpdateInterval = keys.getKeyUpdateInterval();
long blockTokenLifetime = keys.getTokenLifetime();
LOG.info("Block token params received from NN: " +
"for block pool {} keyUpdateInterval={} min(s), " +
"tokenLifetime={} min(s)",
blockPoolId, blockKeyUpdateInterval / (60 * 1000),
blockTokenLifetime / (60 * 1000));
final boolean enableProtobuf = getConf().getBoolean(
DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_PROTOBUF_ENABLE,
DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_PROTOBUF_ENABLE_DEFAULT);
final BlockTokenSecretManager secretMgr = View on GitHub (pinned to 2add963021)
Solutions
- Set dfs.block.access.token.enable consistently for all block pools / NameNodes federated to this DataNode, either enabled everywhere or nowhere.
- Review hdfs-site.xml for per-nameservice overrides that enable block tokens for only some NameNodes.
When it happens
Trigger: In a federated setup, some block pools have block access tokens enabled while others do not, which the DataNode cannot support simultaneously.
Common situations: Some block pools have block access tokens enabled while others do not. Make dfs.block.access.token.enable consistent across all NameNodes in the federation.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/4987018e304ccaf3.
Report an issue: GitHub.