apache/hadoop · error · SnapshotException

Failed to delete snapshot {} from {} since {} is not the fir

Error message

Failed to delete snapshot {} from {} since {} is not the first snapshot (={}) and dfs.namenode.snapshot.deletion.ordered is {}

What it means

Error "Failed to delete snapshot {} from {} since {} is not the first snapshot (={}) and dfs.namenode.snapshot.deletion.ordered is {}" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotManager.java:364

      return;
    }
    // prior must not exist
    if (prior != Snapshot.NO_SNAPSHOT_ID) {
      throw new SnapshotException("Failed to removeSnapshot "
          + snapshotName + " from " + dir.getFullPathName()
          + ": Unexpected prior (=" + prior + ") when "
          + DFS_NAMENODE_SNAPSHOT_DELETION_ORDERED
          + " is " + isSnapshotDeletionOrdered());
    }
  }

  void assertFirstSnapshot(INodeDirectory dir,
      DirectorySnapshottableFeature snapshottable, Snapshot snapshot)
      throws SnapshotException {
    final INodeDirectoryAttributes first
        = snapshottable.getDiffs().getFirstSnapshotINode();
    if (snapshot.getRoot() != first) {
      throw new SnapshotException("Failed to delete snapshot " + snapshot
          + " from " + dir.getFullPathName() + " since " + snapshot
          + " is not the first snapshot (=" + first + ") and "
          + DFS_NAMENODE_SNAPSHOT_DELETION_ORDERED
          + " is " + isSnapshotDeletionOrdered());
    }
  }

  /**
   * Return CaptureOpenFiles config value.
   */
  boolean captureOpenFiles() {
    return captureOpenFiles;
  }

  @VisibleForTesting
  int getMaxSnapshotLimit() {
    return maxSnapshotLimit;
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Delete the earliest snapshot first when dfs.namenode.snapshot.deletion.ordered is enabled, or disable ordered deletion.

When it happens

Trigger: A snapshot other than the first is deleted while ordered snapshot deletion is configured.

Common situations: Removing a middle/newest snapshot with dfs.namenode.snapshot.deletion.ordered=true.


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