{"record":{"id":"1d1f28e158b45670","repo":"apache/hadoop","slug":"required-edits-directory-not-found-dfs-namenod","errorCode":null,"errorMessage":"Required edits directory {} not found: dfs.namenode.edits.dir={}; dfs.namenode.edits.dir.required={}; dfs.namenode.shared.edits.dir={}","messagePattern":"Required edits directory (.+?) not found: dfs\\.namenode\\.edits\\.dir=(.+?); dfs\\.namenode\\.edits\\.dir\\.required=(.+?); dfs\\.namenode\\.shared\\.edits\\.dir=(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java","lineNumber":803,"sourceCode":"        FSNamesystem.getNamespaceDirs(conf);\n    final Collection<URI> editsDirs =\n        FSNamesystem.getNamespaceEditsDirs(conf);\n    final Collection<URI> requiredEditsDirs =\n        FSNamesystem.getRequiredNamespaceEditsDirs(conf);\n    final Collection<URI> sharedEditsDirs =\n        FSNamesystem.getSharedEditsDirs(conf);\n\n    for (URI u : requiredEditsDirs) {\n      if (u.toString().compareTo(\n              DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_DEFAULT) == 0) {\n        continue;\n      }\n\n      // Each required directory must also be in editsDirs or in\n      // sharedEditsDirs.\n      if (!editsDirs.contains(u) &&\n          !sharedEditsDirs.contains(u)) {\n        throw new IllegalArgumentException(\"Required edits directory \" + u\n            + \" not found: \"\n            + DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_KEY + \"=\" + editsDirs + \"; \"\n            + DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_REQUIRED_KEY\n            + \"=\" + requiredEditsDirs + \"; \"\n            + DFSConfigKeys.DFS_NAMENODE_SHARED_EDITS_DIR_KEY\n            + \"=\" + sharedEditsDirs);\n      }\n    }\n\n    if (namespaceDirs.size() == 1) {\n      LOG.warn(\"Only one image storage directory (\"\n          + DFS_NAMENODE_NAME_DIR_KEY + \") configured. Beware of data loss\"\n          + \" due to lack of redundant storage directories!\");\n    }\n    if (editsDirs.size() == 1) {\n      LOG.warn(\"Only one namespace edits storage directory (\"\n          + DFS_NAMENODE_EDITS_DIR_KEY + \") configured. Beware of data loss\"\n          + \" due to lack of redundant storage directories!\");","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L785-L821","documentation":"During FSNamesystem configuration validation, every URI in dfs.namenode.edits.dir.required (minus the default placeholder) must also appear in dfs.namenode.edits.dir or dfs.namenode.shared.edits.dir. A required dir configured nowhere else aborts NN startup with this IllegalArgumentException listing all three settings. Comparison is exact, so scheme/spelling differences count as missing.","triggerScenarios":"FSNamesystem construction with dfs.namenode.edits.dir.required containing a URI absent from dfs.namenode.edits.dir and dfs.namenode.shared.edits.dir — e.g. 'file:///dfs/edits' vs 'file:/dfs/edits', different hostname, or a plain typo.","commonSituations":"Hardening configs copied from docs where the required list names a dir never added to the main list; URI normalization mismatches (file:/// vs file:/, trailing slash); moving journals to dedicated disks.","solutions":["Add the required URI verbatim to dfs.namenode.edits.dir (or to dfs.namenode.shared.edits.dir if it is a shared journal)","Normalize URI spelling: identical scheme, authority and path in both properties","Drop the entry from dfs.namenode.edits.dir.required if it no longer needs to be mandatory","Restart the NameNode and confirm the validation passes"],"exampleFix":"<!-- before -->\n<property><name>dfs.namenode.edits.dir.required</name><value>file:///dfs/edits</value></property>\n<property><name>dfs.namenode.edits.dir</name><value>file:///dfs/name</value></property>\n<!-- after: the required dir is listed in edits.dir, spelled identically -->\n<property><name>dfs.namenode.edits.dir</name><value>file:///dfs/edits,file:///dfs/name</value></property>","handlingStrategy":"validation","validationCode":"Collection<URI> edits = FSNamesystem.getEditsDirs(conf);\nfor (URI u : FSNamesystem.getRequiredEditsDirs(conf)) {\n  if (u.toString().equals(DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_DEFAULT)) continue;\n  if (!edits.contains(u)\n      && !FSNamesystem.getSharedEditsDirs(conf).contains(u)) {\n    throw new IllegalArgumentException(\"required edits dir \" + u\n        + \" missing from dfs.namenode.edits.dir / shared.edits.dir\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a config linter that diffs edits.dir.required against edits.dir before deploy","Normalize all URI properties through one templating mechanism to avoid file:/// vs file:/ drift","When moving journals, update both properties in the same change"],"tags":["hadoop","hdfs","namenode","configuration","edits-dir","startup"],"backgroundTag":"config-validation-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}