{"record":{"id":"1d964b3c4d19bffd","repo":"apache/hadoop","slug":"cannot-provisionsnapshottrash-through-a-symlink-to","errorCode":null,"errorMessage":"Cannot provisionSnapshotTrash through a symlink to a non-DistributedFileSystem: {} -> {}","messagePattern":"Cannot provisionSnapshotTrash through a symlink to a non-DistributedFileSystem: (.+?) -> (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":3176,"sourceCode":"   * @param trashPermission Expected FsPermission of the trash root.\n   * @return Path of the provisioned trash root\n   */\n  public Path provisionSnapshotTrash(final Path path,\n      final FsPermission trashPermission) throws IOException {\n    Path absF = fixRelativePart(path);\n    return new FileSystemLinkResolver<Path>() {\n      @Override\n      public Path doCall(Path p) throws IOException {\n        return provisionSnapshotTrash(getPathName(p), trashPermission);\n      }\n\n      @Override\n      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);","sourceCodeStart":3158,"sourceCodeEnd":3194,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3158-L3194","documentation":"Error \"Cannot provisionSnapshotTrash through a symlink to a non-DistributedFileSystem: {} -> {}\" thrown in apache/hadoop.","triggerScenarios":"provisionSnapshotTrash is invoked through a symlink whose target is not a DistributedFileSystem, so snapshot trash cannot be provisioned.","commonSituations":"See trigger scenarios.","solutions":["Call provisionSnapshotTrash on the real DistributedFileSystem path.","Resolve symlinks before provisioning snapshot trash."],"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-23T01:17:44.959Z"}