{"record":{"id":"be340dfbdcac58c3","repo":"apache/hadoop","slug":"cachemanager-section-had-no-numdirectives","errorCode":null,"errorMessage":"CacheManager section had no <numDirectives>","messagePattern":"CacheManager section had no <numDirectives>","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":1091,"sourceCode":"      Node node = new Node();\n      loadNodeChildren(node, \"CacheManager fields\", \"pool\", \"directive\");\n      CacheManagerSection.Builder b =  CacheManagerSection.newBuilder();\n      Long nextDirectiveId =\n          node.removeChildLong(CACHE_MANAGER_SECTION_NEXT_DIRECTIVE_ID);\n      if (nextDirectiveId == null) {\n        throw new IOException(\"CacheManager section had no <nextDirectiveId>\");\n      }\n      b.setNextDirectiveId(nextDirectiveId);\n      Integer expectedNumPools =\n          node.removeChildInt(CACHE_MANAGER_SECTION_NUM_POOLS);\n      if (expectedNumPools == null) {\n        throw new IOException(\"CacheManager section had no <numPools>\");\n      }\n      b.setNumPools(expectedNumPools);\n      Integer expectedNumDirectives =\n          node.removeChildInt(CACHE_MANAGER_SECTION_NUM_DIRECTIVES);\n      if (expectedNumDirectives == null) {\n        throw new IOException(\"CacheManager section had no <numDirectives>\");\n      }\n      b.setNumDirectives(expectedNumDirectives);\n      b.build().writeDelimitedTo(out);\n      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) {","sourceCodeStart":1073,"sourceCodeEnd":1109,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L1073-L1109","documentation":"Error \"CacheManager section had no <numDirectives>\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when the CacheManager section header lacks the <numDirectives> element.","commonSituations":"See trigger scenarios.","solutions":["Add the missing <numDirectives> element to the CacheManager section of the fsimage XML.","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"}