{"record":{"id":"38f93317e6b18f95","repo":"apache/hadoop","slug":"directory-is-not-a-snapshottable-directory-38f933","errorCode":null,"errorMessage":"Directory is not a snapshottable directory: {}","messagePattern":"Directory is not a 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/snapshot/SnapshotManager.java","lineNumber":323,"sourceCode":"    }\n    removeSnapshottable(d);\n  }\n\n  /**\n  * Find the source root directory where the snapshot will be taken\n  * for a given path.\n  *\n  * @return Snapshottable directory.\n  * @throws IOException\n  *           Throw IOException when the given path does not lead to an\n  *           existing snapshottable directory.\n  */\n  public INodeDirectory getSnapshottableRoot(final INodesInPath iip)\n      throws IOException {\n    final String path = iip.getPath();\n    final INodeDirectory dir = INodeDirectory.valueOf(iip.getLastINode(), path);\n    if (!dir.isSnapshottable()) {\n      throw new SnapshotException(\n          \"Directory is not a snapshottable directory: \" + path);\n    }\n    return dir;\n  }\n\n  public void assertMarkedAsDeleted(INodesInPath iip, String snapshotName)\n      throws IOException {\n    final INodeDirectory dir = getSnapshottableRoot(iip);\n    final Snapshot.Root snapshotRoot = dir.getDirectorySnapshottableFeature()\n        .getSnapshotByName(dir, snapshotName)\n        .getRoot();\n\n    if (!snapshotRoot.isMarkedAsDeleted()) {\n      throw new SnapshotException(\"Failed to gcDeletedSnapshot \"\n          + snapshotName + \" from \" + dir.getFullPathName()\n          + \": snapshot is not marked as deleted\");\n    }\n  }","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotManager.java#L305-L341","documentation":"Error \"Directory is not a snapshottable directory: {}\" thrown in apache/hadoop.","triggerScenarios":"A snapshot operation targets a directory that is not snapshottable.","commonSituations":"Creating or deleting snapshots on a directory where allowSnapshot was not run.","solutions":["Enable snapshot capability on the directory with 'hdfs dfsadmin -allowSnapshot <path>' before snapshot operations."],"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"}