{"record":{"id":"8e15f83814def0da","repo":"apache/hadoop","slug":"will-not-provision-new-trash-directory-for-encrypt","errorCode":null,"errorMessage":"Will not provision new trash directory for encryption zone {}. Path already exists.","messagePattern":"Will not provision new trash directory for encryption zone (.+?)\\. Path already exists\\.","errorType":"exception","errorClass":"FileAlreadyExistsException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":3143,"sourceCode":"          \"encryption zone. Do you mean \" + ez.getPath() + \"?\");\n    }\n\n    // check if the trash directory exists\n    Path trashPath = new Path(ez.getPath(), FileSystem.TRASH_PREFIX);\n    try {\n      FileStatus trashFileStatus = getFileStatus(trashPath);\n      String errMessage = \"Will not provision new trash directory for \" +\n          \"encryption zone \" + ez.getPath() + \". Path already exists.\";\n      if (!trashFileStatus.isDirectory()) {\n        errMessage += \"\\r\\n\" +\n            \"Warning: \" + trashPath.toString() + \" is not a directory\";\n      }\n      if (!trashFileStatus.getPermission().equals(trashPermission)) {\n        errMessage += \"\\r\\n\" +\n            \"Warning: the permission of \" +\n            trashPath.toString() + \" is not \" + trashPermission;\n      }\n      throw new FileAlreadyExistsException(errMessage);\n    } catch (FileNotFoundException ignored) {\n      // no trash path\n    }\n\n    // Update the permission bits\n    mkdir(trashPath, trashPermission);\n    setPermission(trashPath, trashPermission);\n  }\n\n  /**\n   * HDFS only.\n   *\n   * Provision snapshottable directory trash.\n   * @param path Path to a snapshottable directory.\n   * @param trashPermission Expected FsPermission of the trash root.\n   * @return Path of the provisioned trash root\n   */\n  public Path provisionSnapshotTrash(final Path path,","sourceCodeStart":3125,"sourceCodeEnd":3161,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3125-L3161","documentation":"Error \"Will not provision new trash directory for encryption zone {}. Path already exists.\" thrown in apache/hadoop.","triggerScenarios":"provisioning an encryption-zone trash directory is requested, but the trash path for that zone already exists, so no new directory is created.","commonSituations":"See trigger scenarios.","solutions":["Remove or rename the existing trash path before provisioning new EZ trash.","Skip provisioning if the trash directory already exists and is valid."],"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"}