{"record":{"id":"682049e2f80f5b29","repo":"apache/hadoop","slug":"cachemanager-section-had-no-nextdirectiveid","errorCode":null,"errorMessage":"CacheManager section had no <nextDirectiveId>","messagePattern":"CacheManager section had no <nextDirectiveId>","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":1079,"sourceCode":"        return date.getTime();\n      } catch (ParseException e) {\n        throw new IOException(\"Failed to parse ISO date string \" + dateStr, e);\n      }\n    }\n  }\n\n  private class CacheManagerSectionProcessor implements SectionProcessor {\n    static final String NAME = \"CacheManagerSection\";\n\n    @Override\n    public void process() throws IOException {\n      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 {","sourceCodeStart":1061,"sourceCodeEnd":1097,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L1061-L1097","documentation":"Error \"CacheManager section had no <nextDirectiveId>\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when the CacheManager section header of the fsimage XML lacks the <nextDirectiveId> element.","commonSituations":"See trigger scenarios.","solutions":["Add the missing <nextDirectiveId> 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"}