{"record":{"id":"d1f36bdd28a9340c","repo":"apache/hadoop","slug":"cannot-import-image-from-a-checkpoint-dfs-nameno-d1f36b","errorCode":null,"errorMessage":"Cannot import image from a checkpoint. \"dfs.namenode.checkpoint.edits.dir\" is not set.","messagePattern":"Cannot import image from a checkpoint\\. \"dfs\\.namenode\\.checkpoint\\.edits\\.dir\" is not set\\.","errorType":"exception","errorClass":"java.io.IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java","lineNumber":590,"sourceCode":"\n  /**\n   * Load image from a checkpoint directory and save it into the current one.\n   * @param target the NameSystem to import into\n   * @throws IOException\n   */\n  void doImportCheckpoint(FSNamesystem target) throws IOException {\n    Collection<URI> checkpointDirs =\n      FSImage.getCheckpointDirs(conf, null);\n    List<URI> checkpointEditsDirs =\n      FSImage.getCheckpointEditsDirs(conf, null);\n\n    if (checkpointDirs == null || checkpointDirs.isEmpty()) {\n      throw new IOException(\"Cannot import image from a checkpoint. \"\n                            + \"\\\"dfs.namenode.checkpoint.dir\\\" is not set.\");\n    }\n    \n    if (checkpointEditsDirs == null || checkpointEditsDirs.isEmpty()) {\n      throw new IOException(\"Cannot import image from a checkpoint. \"\n                            + \"\\\"dfs.namenode.checkpoint.edits.dir\\\" is not set.\");\n    }\n\n    FSImage realImage = target.getFSImage();\n    FSImage ckptImage = new FSImage(conf, \n                                    checkpointDirs, checkpointEditsDirs);\n    // load from the checkpoint dirs\n    try {\n      ckptImage.recoverTransitionRead(StartupOption.REGULAR, target, null);\n    } finally {\n      ckptImage.close();\n    }\n    // return back the real image\n    realImage.getStorage().setStorageInfo(ckptImage.getStorage());\n    realImage.getEditLog().setNextTxId(ckptImage.getEditLog().getLastWrittenTxId()+1);\n    realImage.initEditLog(StartupOption.IMPORT);\n\n    realImage.getStorage().setBlockPoolID(ckptImage.getBlockPoolID());","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java#L572-L608","documentation":"Same import preflight as for dfs.namenode.checkpoint.dir, but for dfs.namenode.checkpoint.edits.dir — the location of the checkpointed edit segments. When it resolves to nothing, doImportCheckpoint() cannot proceed. Both properties must be set for an import.","triggerScenarios":"Running 'hdfs namenode -importCheckpoint' with dfs.namenode.checkpoint.dir configured but dfs.namenode.checkpoint.edits.dir omitted; typo'd property name; wrong HADOOP_CONF_DIR.","commonSituations":"DR configs that only copy half the checkpoint settings; hand-built recovery nodes; config templates that skip the edits checkpoint key.","solutions":["Set dfs.namenode.checkpoint.edits.dir to the directory holding the checkpointed edits (often the same location as the checkpointed fsimage).","Copy the checkpointed edits files from the checkpointer node to that directory.","Re-run 'hdfs namenode -importCheckpoint' with empty NameNode dirs."],"exampleFix":"<!-- before: only the image dir is set -->\n<property>\n  <name>dfs.namenode.checkpoint.dir</name>\n  <value>file:///dfs/checkpoint</value>\n</property>\n\n<!-- after -->\n<property>\n  <name>dfs.namenode.checkpoint.dir</name>\n  <value>file:///dfs/checkpoint</value>\n</property>\n<property>\n  <name>dfs.namenode.checkpoint.edits.dir</name>\n  <value>file:///dfs/checkpoint</value>\n</property>","handlingStrategy":"validation","validationCode":"List<URI> ckptEdits = FSImage.getCheckpointEditsDirs(conf, null);\nif (ckptEdits == null || ckptEdits.isEmpty()) {\n  throw new IllegalStateException(\n      \"dfs.namenode.checkpoint.edits.dir must be set before -importCheckpoint\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set both checkpoint dir keys together in DR configs.","Validate both keys with 'hdfs getconf' before running the import."],"tags":["hdfs","namenode","checkpoint","import","configuration"],"backgroundTag":"missing-configuration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}