{"record":{"id":"e3ac8d906325a3c0","repo":"apache/hadoop","slug":"cannot-remove-non-existent-cache-pool-poolname","errorCode":null,"errorMessage":"Cannot remove non-existent cache pool poolName","messagePattern":"Cannot remove non-existent cache pool poolName","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java","lineNumber":924,"sourceCode":"        bld.toString());\n  }\n\n  /**\n   * Remove a cache pool.\n   * \n   * Only the superuser should be able to call this function.\n   *\n   * @param poolName\n   *          The name for the cache pool to remove.\n   */\n  public void removeCachePool(String poolName)\n      throws IOException {\n    assert namesystem.hasWriteLock(RwLockMode.FS);\n    try {\n      CachePoolInfo.validateName(poolName);\n      CachePool pool = cachePools.remove(poolName);\n      if (pool == null) {\n        throw new InvalidRequestException(\n            \"Cannot remove non-existent cache pool \" + poolName);\n      }\n      // Remove all directives in this pool.\n      Iterator<CacheDirective> iter = pool.getDirectiveList().iterator();\n      while (iter.hasNext()) {\n        CacheDirective directive = iter.next();\n        directivesByPath.removeAll(directive.getPath());\n        directivesById.remove(directive.getId());\n        iter.remove();\n      }\n      setNeedsRescan();\n    } catch (IOException e) {\n      LOG.info(\"removeCachePool of \" + poolName + \" failed: \", e);\n      throw e;\n    }\n    LOG.info(\"removeCachePool of \" + poolName + \" successful.\");\n  }\n","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L906-L942","documentation":"Error \"Cannot remove non-existent cache pool poolName\" thrown in apache/hadoop.","triggerScenarios":"removeCachePool naming a pool that does not exist.","commonSituations":"See trigger scenarios.","solutions":["Verify the pool name with hdfs cacheadmin -listPools before removing; the pool may already be deleted."],"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"}