{"record":{"id":"36a277b87008b83c","repo":"apache/hadoop","slug":"directive-found-without-replication","errorCode":null,"errorMessage":"<directive> found without <replication>","messagePattern":"<directive> found without <replication>","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":1180,"sourceCode":"      bld.build().writeDelimitedTo(out);\n    }\n\n    private void processDirectiveXml(Node directive) throws IOException {\n      CacheDirectiveInfoProto.Builder bld =\n          CacheDirectiveInfoProto.newBuilder();\n      Long id = directive.removeChildLong(SECTION_ID);\n      if (id == null) {\n        throw new IOException(\"<directive> found without <id>\");\n      }\n      bld.setId(id);\n      String path = directive.removeChildStr(SECTION_PATH);\n      if (path == null) {\n        throw new IOException(\"<directive> found without <path>\");\n      }\n      bld.setPath(path);\n      Integer replication = directive.removeChildInt(SECTION_REPLICATION);\n      if (replication == null) {\n        throw new IOException(\"<directive> found without <replication>\");\n      }\n      bld.setReplication(replication);\n      String pool = directive.removeChildStr(CACHE_MANAGER_SECTION_POOL);\n      if (path == null) {\n        throw new IOException(\"<directive> found without <pool>\");\n      }\n      bld.setPool(pool);\n      Node expiration =\n          directive.removeChild(CACHE_MANAGER_SECTION_EXPIRATION);\n      if (expiration != null) {\n        CacheDirectiveInfoExpirationProto.Builder ebld =\n            CacheDirectiveInfoExpirationProto.newBuilder();\n        Long millis =\n            expiration.removeChildLong(CACHE_MANAGER_SECTION_MILLIS);\n        if (millis == null) {\n          throw new IOException(\"cache directive <expiration> found \" +\n              \"without <millis>\");\n        }","sourceCodeStart":1162,"sourceCodeEnd":1198,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L1162-L1198","documentation":"Error \"<directive> found without <replication>\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when a <directive> stanza lacks the mandatory <replication> element.","commonSituations":"See trigger scenarios.","solutions":["Add the missing <replication> element to the <directive> stanza in 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"}