{"record":{"id":"4987018e304ccaf3","repo":"apache/hadoop","slug":"inconsistent-configuration-of-block-access-tokens","errorCode":null,"errorMessage":"Inconsistent configuration of block access tokens. Either all block pools must be configured to use block tokens, or none may be.","messagePattern":"Inconsistent configuration of block access tokens\\. Either all block pools must be configured to use block tokens, or none may be\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java","lineNumber":2123,"sourceCode":"    }\n    \n    registerBlockPoolWithSecretManager(bpRegistration, blockPoolId);\n  }\n  \n  /**\n   * After the block pool has contacted the NN, registers that block pool\n   * with the secret manager, updating it with the secrets provided by the NN.\n   * @throws IOException on error\n   */\n  private synchronized void registerBlockPoolWithSecretManager(\n      DatanodeRegistration bpRegistration, String blockPoolId) throws IOException {\n    ExportedBlockKeys keys = bpRegistration.getExportedKeys();\n    if (!hasAnyBlockPoolRegistered) {\n      hasAnyBlockPoolRegistered = true;\n      isBlockTokenEnabled = keys.isBlockTokenEnabled();\n    } else {\n      if (isBlockTokenEnabled != keys.isBlockTokenEnabled()) {\n        throw new RuntimeException(\"Inconsistent configuration of block access\"\n            + \" tokens. Either all block pools must be configured to use block\"\n            + \" tokens, or none may be.\");\n      }\n    }\n    if (!isBlockTokenEnabled) return;\n    \n    if (!blockPoolTokenSecretManager.isBlockPoolRegistered(blockPoolId)) {\n      long blockKeyUpdateInterval = keys.getKeyUpdateInterval();\n      long blockTokenLifetime = keys.getTokenLifetime();\n      LOG.info(\"Block token params received from NN: \" +\n          \"for block pool {} keyUpdateInterval={} min(s), \" +\n          \"tokenLifetime={} min(s)\",\n          blockPoolId, blockKeyUpdateInterval / (60 * 1000),\n          blockTokenLifetime / (60 * 1000));\n      final boolean enableProtobuf = getConf().getBoolean(\n          DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_PROTOBUF_ENABLE,\n          DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_PROTOBUF_ENABLE_DEFAULT);\n      final BlockTokenSecretManager secretMgr = ","sourceCodeStart":2105,"sourceCodeEnd":2141,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L2105-L2141","documentation":"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.","triggerScenarios":"In a federated setup, some block pools have block access tokens enabled while others do not, which the DataNode cannot support simultaneously.","commonSituations":"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.","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."],"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-23T01:17:44.959Z"}