{"record":{"id":"a829f091d32688f7","repo":"apache/hadoop","slug":"the-block-pool-is-still-running-first-do-a-refres","errorCode":null,"errorMessage":"The block pool is still running. First do a refreshNamenodes to shutdown the block pool service","messagePattern":"The block pool is still running\\. First do a refreshNamenodes to shutdown the block pool service","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":3854,"sourceCode":"  }\n\n  @Override // ClientDatanodeProtocol\n  public void refreshNamenodes() throws IOException {\n    checkSuperuserPrivilege();\n    setConf(new Configuration());\n    refreshNamenodes(getConf());\n  }\n  \n  @Override // ClientDatanodeProtocol\n  public void deleteBlockPool(String blockPoolId, boolean force)\n      throws IOException {\n    checkSuperuserPrivilege();\n    LOG.info(\"deleteBlockPool command received for block pool {}, \" +\n        \"force={}\", blockPoolId, force);\n    if (blockPoolManager.get(blockPoolId) != null) {\n      LOG.warn(\"The block pool {} is still running, cannot be deleted.\",\n          blockPoolId);\n      throw new IOException(\n          \"The block pool is still running. First do a refreshNamenodes to \" +\n          \"shutdown the block pool service\");\n    }\n    checkStorageState(\"deleteBlockPool\");\n    data.deleteBlockPool(blockPoolId, force);\n  }\n\n  /**\n   * Check if storage has been initialized.\n   * @param methodName caller name\n   * @throws IOException throw IOException if not yet initialized.\n   */\n  private void checkStorageState(String methodName) throws IOException {\n    if (data == null) {\n      String message = \"Storage not yet initialized for \" + methodName;\n      LOG.debug(message);\n      throw new IOException(message);\n    }","sourceCodeStart":3836,"sourceCodeEnd":3872,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L3836-L3872","documentation":"Error \"The block pool is still running. First do a refreshNamenodes to shutdown the block pool service\" thrown in apache/hadoop.","triggerScenarios":"Attempting to remove/shutdown a block pool's storage while its BPOfferService thread is still running.","commonSituations":"An admin operation tried to remove a block pool whose service thread is still running. Run refreshNamenodes first to stop the block pool service.","solutions":["Run 'hdfs dfsadmin -refreshNamenodes <datanode_host:port>' to shut down the block pool service, then retry the operation (e.g., shutdownDatanode or deleteBlockPool).","Do not forcibly delete block pool storage while the BPOfferService is active."],"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"}