{"record":{"id":"0a6718a92b5a5e6b","repo":"apache/hadoop","slug":"namespaceinfo-not-found-block-pool-should-have","errorCode":null,"errorMessage":"NamespaceInfo not found: Block pool {} should have retrieved namespace info before initBlockPool.","messagePattern":"NamespaceInfo not found: Block pool (.+?) should have retrieved namespace info before initBlockPool\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java","lineNumber":2188,"sourceCode":"    }\n\n  }\n\n  /**\n   * One of the Block Pools has successfully connected to its NN.\n   * This initializes the local storage for that block pool,\n   * checks consistency of the NN's cluster ID, etc.\n   * \n   * If this is the first block pool to register, this also initializes\n   * the datanode-scoped storage.\n   * \n   * @param bpos Block pool offer service\n   * @throws IOException if the NN is inconsistent with the local storage.\n   */\n  void initBlockPool(BPOfferService bpos) throws IOException {\n    NamespaceInfo nsInfo = bpos.getNamespaceInfo();\n    if (nsInfo == null) {\n      throw new IOException(\"NamespaceInfo not found: Block pool \" + bpos\n          + \" should have retrieved namespace info before initBlockPool.\");\n    }\n    \n    setClusterId(nsInfo.clusterID, nsInfo.getBlockPoolID());\n\n    // Register the new block pool with the BP manager.\n    blockPoolManager.addBlockPool(bpos);\n    \n    // In the case that this is the first block pool to connect, initialize\n    // the dataset, block scanners, etc.\n    initStorage(nsInfo);\n\n    try {\n      data.addBlockPool(nsInfo.getBlockPoolID(), getConf());\n    } catch (AddBlockPoolException e) {\n      handleAddBlockPoolError(e);\n    }\n    // HDFS-14993: check disk after add the block pool info.","sourceCodeStart":2170,"sourceCodeEnd":2206,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L2170-L2206","documentation":"Error \"NamespaceInfo not found: Block pool {} should have retrieved namespace info before initBlockPool.\" thrown in apache/hadoop.","triggerScenarios":"initBlockPool is invoked for a block pool whose NamespaceInfo was never retrieved, typically due to a failed or skipped NameNode handshake.","commonSituations":"initBlockPool ran before namespace info was retrieved, an internal ordering issue typically triggered by a race during block pool registration. Restart the DataNode.","solutions":["Ensure the DataNode successfully registered and handshook with the NameNode for that block pool before initBlockPool; check earlier log lines for handshake failures.","Verify network connectivity and NameNode availability for the nameservice owning the block pool id."],"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-22T20:17:22.307Z"}