{"record":{"id":"9399085993e4eb57","repo":"apache/hadoop","slug":"is-not-a-snapshottable-directory","errorCode":null,"errorMessage":"{} is not a snapshottable directory.","messagePattern":"(.+?) is not a snapshottable directory\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":3189,"sourceCode":"      public Path next(FileSystem fs, Path p) throws IOException {\n        if (fs instanceof DistributedFileSystem) {\n          DistributedFileSystem myDfs = (DistributedFileSystem)fs;\n          return myDfs.provisionSnapshotTrash(p, trashPermission);\n        }\n        throw new UnsupportedOperationException(\n            \"Cannot provisionSnapshotTrash through a symlink to\" +\n            \" a non-DistributedFileSystem: \" + fs + \" -> \" + p);\n      }\n    }.resolve(this, absF);\n  }\n\n  private Path provisionSnapshotTrash(\n      String pathStr, FsPermission trashPermission) throws IOException {\n    Path path = new Path(pathStr);\n    // Given path must be a snapshottable directory\n    FileStatus fileStatus = getFileStatus(path);\n    if (!fileStatus.isSnapshotEnabled()) {\n      throw new IllegalArgumentException(\n          path + \" is not a snapshottable directory.\");\n    }\n\n    // Check if trash root already exists\n    Path trashPath = new Path(path, FileSystem.TRASH_PREFIX);\n    try {\n      FileStatus trashFileStatus = getFileStatus(trashPath);\n      boolean throwException = false;\n      String errMessage = \"Can't provision trash for snapshottable directory \" +\n          pathStr + \" because trash path \" + trashPath.toString() +\n          \" already exists.\";\n      if (!trashFileStatus.isDirectory()) {\n        throwException = true;\n        errMessage += \"\\r\\n\" +\n            \"WARNING: \" + trashPath.toString() + \" is not a directory.\";\n      }\n      if (!trashFileStatus.getPermission().equals(trashPermission)) {\n        throwException = true;","sourceCodeStart":3171,"sourceCodeEnd":3207,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3171-L3207","documentation":"Error \"{} is not a snapshottable directory.\" thrown in apache/hadoop.","triggerScenarios":"provisionSnapshotTrash or a snapshot operation is attempted on a directory that is not marked snapshottable.","commonSituations":"See trigger scenarios.","solutions":["Enable snapshots on the directory with hdfs dfsadmin -allowSnapshot before provisioning trash.","Verify the directory is snapshottable via lsSnapshottableDir."],"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"}