{"record":{"id":"1566acf7534b6343","repo":"apache/hadoop","slug":"unable-to-rename-because-has-snapshottable-desc","errorCode":null,"errorMessage":"Unable to rename because {} has snapshottable descendant directories and {} is a descent of a snapshottable directory, and HDFS does not support nested snapshottable directory.","messagePattern":"Unable to rename because (.+?) has snapshottable descendant directories and (.+?) is a descent of a snapshottable directory, and HDFS does not support nested snapshottable directory\\.","errorType":"exception","errorClass":"SnapshotException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java","lineNumber":637,"sourceCode":"\n  private static void validateNestSnapshot(FSDirectory fsd, String srcPath,\n      INodeDirectory dstParent, List<INodeDirectory> snapshottableDirs)\n      throws SnapshotException {\n\n    if (fsd.getFSNamesystem().getSnapshotManager().isAllowNestedSnapshots()) {\n      return;\n    }\n\n    /*\n     * snapshottableDirs is a list of snapshottable directory (child of rename\n     * src) which do not have snapshots yet. If this list is not empty, that\n     * means rename src has snapshottable descendant directories.\n     */\n    if (snapshottableDirs != null && snapshottableDirs.size() > 0) {\n      if (fsd.getFSNamesystem().getSnapshotManager()\n              .isDescendantOfSnapshotRoot(dstParent)) {\n        String dstPath = dstParent.getFullPathName();\n        throw new SnapshotException(\"Unable to rename because \" + srcPath\n                + \" has snapshottable descendant directories and \" + dstPath\n                + \" is a descent of a snapshottable directory, and HDFS does\"\n                + \" not support nested snapshottable directory.\");\n      }\n    }\n  }\n\n  private static class RenameOperation {\n    private final FSDirectory fsd;\n    private INodesInPath srcIIP;\n    private final INodesInPath srcParentIIP;\n    private INodesInPath dstIIP;\n    private final INodesInPath dstParentIIP;\n    private final INodeReference.WithCount withCount;\n    private final int srcRefDstSnapshot;\n    private final INodeDirectory srcParent;\n    private final byte[] srcChildName;\n    private final boolean isSrcInSnapshot;","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java#L619-L655","documentation":"Error \"Unable to rename because {} has snapshottable descendant directories and {} is a descent of a snapshottable directory, and HDFS does not support nested snapshottable directory.\" thrown in apache/hadoop.","triggerScenarios":"Renaming a directory that has snapshottable descendants into a location under another snapshottable directory, which would create nested snapshottable directories.","commonSituations":"See trigger scenarios.","solutions":["Avoid renaming across snapshottable directory boundaries that would create nested snapshottable directories.","Disallow snapshots on one of the directories (hdfs dfsadmin -disallowSnapshot) before renaming."],"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"}