{"record":{"id":"3dccb847f0927797","repo":"apache/hadoop","slug":"acls-not-supported-for-file-system-uri","errorCode":null,"errorMessage":"ACLs not supported for file system: {uri}","messagePattern":"ACLs not supported for file system: (.+?)","errorType":"exception","errorClass":"AclsNotSupportedException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/util/DistCpUtils.java","lineNumber":497,"sourceCode":"\n    sorter.sort(sourceListing, output);\n  }\n\n  /**\n   * Determines if a file system supports ACLs by running a canary getAclStatus\n   * request on the file system root.  This method is used before distcp job\n   * submission to fail fast if the user requested preserving ACLs, but the file\n   * system cannot support ACLs.\n   *\n   * @param fs FileSystem to check\n   * @throws AclsNotSupportedException if fs does not support ACLs\n   */\n  public static void checkFileSystemAclSupport(FileSystem fs)\n      throws AclsNotSupportedException {\n    try {\n      fs.getAclStatus(new Path(Path.SEPARATOR));\n    } catch (Exception e) {\n      throw new AclsNotSupportedException(\"ACLs not supported for file system: \"\n        + fs.getUri());\n    }\n  }\n  \n  /**\n   * Determines if a file system supports XAttrs by running a getXAttrs request\n   * on the file system root. This method is used before distcp job submission\n   * to fail fast if the user requested preserving XAttrs, but the file system\n   * cannot support XAttrs.\n   * \n   * @param fs FileSystem to check\n   * @throws XAttrsNotSupportedException if fs does not support XAttrs\n   */\n  public static void checkFileSystemXAttrSupport(FileSystem fs)\n      throws XAttrsNotSupportedException {\n    try {\n      fs.getXAttrs(new Path(Path.SEPARATOR));\n    } catch (Exception e) {","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/util/DistCpUtils.java#L479-L515","documentation":"Pre-submission fail-fast check: when -p includes ACLs (-pa), DistCpUtils.checkFileSystemAclSupport() calls fs.getAclStatus(new Path(\"/\")); any exception means ACLs cannot be preserved, so CopyListing.AclsNotSupportedException is thrown (the DistCp CLI exits with ACLS_NOT_SUPPORTED = -3) instead of failing mid-copy.","triggerScenarios":"Copying with -pa to or from a filesystem lacking ACL support (S3A, ABFS, local FS, viewfs, older HDFS); HDFS with dfs.namenode.acls.enabled=false; getAclStatus failing due to permission problems on the root path.","commonSituations":"HDFS-to-object-store backup scripts that reuse -pa from HDFS-to-HDFS jobs; freshly installed clusters with ACLs disabled; targets on HDFS versions predating ACLs.","solutions":["Drop 'a' from the -p attribute list when either endpoint lacks ACL support","For HDFS targets, enable ACLs: set dfs.namenode.acls.enabled=true (requires restart)","Probe support before submitting: hdfs dfsgetfacl / or fs.getAclStatus(new Path(\"/\")) in a try/catch","If ACLs are mandatory, keep the destination on an ACL-capable filesystem"],"exampleFix":"# before: object-store target has no ACLs -> AclsNotSupportedException\nhadoop distcp -p a hdfs://nn/src s3a://bucket/dst\n\n# after: preserve only attributes the target supports\nhadoop distcp -p hdfs://nn/src s3a://bucket/dst","handlingStrategy":"validation","validationCode":"static boolean supportsAcls(FileSystem fs) {\n  try {\n    fs.getAclStatus(new Path(Path.SEPARATOR));\n    return true;\n  } catch (Exception e) {\n    return false;\n  }\n}\n// drop FileAttribute.ACL from -p when supportsAcls(source/target) is false","typeGuard":null,"tryCatchPattern":"try {\n  new DistCp(options, conf).execute();\n} catch (CopyListing.AclsNotSupportedException e) {\n  // retry with 'a' removed from the preserve set (CLI exits -3 instead)\n}","preventionTips":["Script the ACL/XAttr capability probe before adding -pa/-px","Keep HDFS-to-HDFS and HDFS-to-object-store flag sets separate","Enable dfs.namenode.acls.enabled when ACL preservation is required"],"tags":["distcp","hadoop","acl","preserve","filesystem-capability"],"backgroundTag":"unsupported-filesystem-feature","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}