{"record":{"id":"c9d62f2c0877be93","repo":"apache/hadoop","slug":"is-not-an-encryption-zone-c9d62f","errorCode":null,"errorMessage":"{} is not an encryption zone.","messagePattern":"(.+?) is not an encryption zone\\.","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":3119,"sourceCode":"      public Void next(FileSystem fs, Path p) throws IOException {\n        if (fs instanceof DistributedFileSystem) {\n          DistributedFileSystem myDfs = (DistributedFileSystem)fs;\n          myDfs.provisionEZTrash(p, trashPermission);\n          return null;\n        }\n        throw new UnsupportedOperationException(\"Cannot provisionEZTrash \" +\n            \"through a symlink to a non-DistributedFileSystem: \" + fs + \" -> \"\n            + p);\n      }\n    }.resolve(this, absF);\n  }\n\n  private void provisionEZTrash(String path, FsPermission trashPermission)\n      throws IOException {\n    // make sure the path is an EZ\n    EncryptionZone ez = dfs.getEZForPath(path);\n    if (ez == null) {\n      throw new IllegalArgumentException(path + \" is not an encryption zone.\");\n    }\n\n    String ezPath = ez.getPath();\n    if (!path.toString().equals(ezPath)) {\n      throw new IllegalArgumentException(path + \" is not the root of an \" +\n          \"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      }","sourceCodeStart":3101,"sourceCodeEnd":3137,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3101-L3137","documentation":"Error \"{} is not an encryption zone.\" thrown in apache/hadoop.","triggerScenarios":"An encryption-zone trash or re-encryption operation is attempted on a path that is not inside any encryption zone.","commonSituations":"See trigger scenarios.","solutions":["Verify the path is an encryption zone root with getEZForPath before reencrypt/zone operations.","Create an encryption zone on the directory first with hdfs crypto -createZone."],"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"}