{"record":{"id":"d1ad0c833b31b788","repo":"apache/hadoop","slug":"only-read-actualnumdirectives-cache-pools-out-o","errorCode":null,"errorMessage":"Only read ${actualNumDirectives} cache pools out of ${expectedNumDirectives}","messagePattern":"Only read (.+?) cache pools out of (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java","lineNumber":1113,"sourceCode":"      long actualNumPools = 0;\n      while (actualNumPools < expectedNumPools) {\n        try {\n          expectTag(CACHE_MANAGER_SECTION_POOL, false);\n        } catch (IOException e) {\n          throw new IOException(\"Only read \" + actualNumPools +\n              \" cache pools out of \" + expectedNumPools, e);\n        }\n        actualNumPools++;\n        Node pool = new Node();\n        loadNodeChildren(pool, \"pool fields\", \"\");\n        processPoolXml(node);\n      }\n      long actualNumDirectives = 0;\n      while (actualNumDirectives < expectedNumDirectives) {\n        try {\n          expectTag(CACHE_MANAGER_SECTION_DIRECTIVE, false);\n        } catch (IOException e) {\n          throw new IOException(\"Only read \" + actualNumDirectives +\n              \" cache pools out of \" + expectedNumDirectives, e);\n        }\n        actualNumDirectives++;\n        Node pool = new Node();\n        loadNodeChildren(pool, \"directive fields\", \"\");\n        processDirectiveXml(node);\n      }\n      expectTagEnd(CACHE_MANAGER_SECTION_NAME);\n      recordSectionLength(SectionName.CACHE_MANAGER.name());\n    }\n\n    private void processPoolXml(Node pool) throws IOException {\n      CachePoolInfoProto.Builder bld = CachePoolInfoProto.newBuilder();\n      String poolName =\n          pool.removeChildStr(CACHE_MANAGER_SECTION_POOL_NAME);\n      if (poolName == null) {\n        throw new IOException(\"<pool> found without <poolName>\");\n      }","sourceCodeStart":1095,"sourceCodeEnd":1131,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L1095-L1131","documentation":"Error \"Only read ${actualNumDirectives} cache pools out of ${expectedNumDirectives}\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when fewer cache directive stanzas are present than the count declared by <numDirectives>.","commonSituations":"See trigger scenarios.","solutions":["The XML is truncated or its <numDirectives> count is wrong; correct the count or add the missing <directive> stanzas.","Regenerate the fsimage XML with 'hdfs oiv' from a valid fsimage."],"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"}