{"record":{"id":"6a3ebdc595aa35b7","repo":"apache/hadoop","slug":"failed-to-save-in-any-storage-directories-while-sa","errorCode":null,"errorMessage":"Failed to save in any storage directories while saving namespace.","messagePattern":"Failed to save in any storage directories while saving namespace\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java","lineNumber":1259,"sourceCode":"        source, txid, canceler);\n    \n    try {\n      List<Thread> saveThreads = new ArrayList<Thread>();\n      // save images into current\n      for (Iterator<StorageDirectory> it\n             = storage.dirIterator(NameNodeDirType.IMAGE); it.hasNext();) {\n        StorageDirectory sd = it.next();\n        FSImageSaver saver = new FSImageSaver(ctx, sd, nnf);\n        Thread saveThread = new Thread(saver, saver.toString());\n        saveThreads.add(saveThread);\n        saveThread.start();\n      }\n      waitForThreads(saveThreads);\n      saveThreads.clear();\n      storage.reportErrorsOnDirectories(ctx.getErrorSDs());\n  \n      if (storage.getNumStorageDirs(NameNodeDirType.IMAGE) == 0) {\n        throw new IOException(\n          \"Failed to save in any storage directories while saving namespace.\");\n      }\n      if (canceler.isCancelled()) {\n        deleteCancelledCheckpoint(txid);\n        ctx.checkCancelled(); // throws\n        assert false : \"should have thrown above!\";\n      }\n  \n      renameCheckpoint(txid, NameNodeFile.IMAGE_NEW, nnf, false);\n  \n      // Since we now have a new checkpoint, we can clean up some\n      // old edit logs and checkpoints.\n      // Do not purge anything if we just wrote a corrupted FsImage.\n      if (!exitAfterSave.get()) {\n        purgeOldStorage(nnf);\n        archivalManager.purgeCheckpoints(NameNodeFile.IMAGE_NEW);\n      }\n    } finally {","sourceCodeStart":1241,"sourceCodeEnd":1277,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java#L1241-L1277","documentation":"Error \"Failed to save in any storage directories while saving namespace.\" thrown in apache/hadoop.","triggerScenarios":"Checkpoint/saveNamespace fails because writing the new image failed in every configured storage directory.","commonSituations":"See trigger scenarios.","solutions":["Check NameNode logs for per-directory failures; fix disk space/permissions on storage directories.","Add or restore at least one healthy edits/name storage directory and retry the checkpoint."],"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"}