apache/hadoop · error · IOException

No image directories available!

Error message

No image directories available!

What it means

Thrown during save/load of an image when no storage directory of type IMAGE is usable — all configured name.dirs image directories are missing or failed, so there is nowhere to write or read the fsimage.

Solutions

  1. Configure dfs.namenode.name.dir with at least one writable storage directory.
  2. Check disk space and permissions on the configured image directories.
Defensive patterns

Strategy: validation

When it happens

Trigger: Saving the namespace when all configured image storage directories have failed or been removed from service.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/cd1372b1222ca9dc. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java:1235

  public void removeFromCheckpointing(long txid) {
    currentlyCheckpointing.remove(txid);
  }

  void save(FSNamesystem src, File dst) throws IOException {
    final long txid = getCorrectLastAppliedOrWrittenTxId();
    LOG.info("save fsimage with txid={} to {}", txid, dst.getAbsolutePath());
    final SaveNamespaceContext context = new SaveNamespaceContext(src, txid, new Canceler());
    final Storage.StorageDirectory storageDirectory = new Storage.StorageDirectory(dst);
    Files.createDirectories(storageDirectory.getCurrentDir().toPath());
    new FSImageSaver(context, storageDirectory, NameNodeFile.IMAGE).run();
  }

  private synchronized void saveFSImageInAllDirs(FSNamesystem source,
      NameNodeFile nnf, long txid, Canceler canceler) throws IOException {
    StartupProgress prog = NameNode.getStartupProgress();
    prog.beginPhase(Phase.SAVING_CHECKPOINT);
    if (storage.getNumStorageDirs(NameNodeDirType.IMAGE) == 0) {
      throw new IOException("No image directories available!");
    }
    if (canceler == null) {
      canceler = new Canceler();
    }
    SaveNamespaceContext ctx = new SaveNamespaceContext(
        source, txid, canceler);
    
    try {
      List<Thread> saveThreads = new ArrayList<Thread>();
      // save images into current
      for (Iterator<StorageDirectory> it
             = storage.dirIterator(NameNodeDirType.IMAGE); it.hasNext();) {
        StorageDirectory sd = it.next();
        FSImageSaver saver = new FSImageSaver(ctx, sd, nnf);
        Thread saveThread = new Thread(saver, saver.toString());
        saveThreads.add(saveThread);
        saveThread.start();
      }

View on GitHub (pinned to 2add963021)