{"record":{"id":"09f122f2c0200f39","repo":"apache/hadoop","slug":"doesn-t-support-getaclstatus-09f122","errorCode":null,"errorMessage":"{} doesn't support getAclStatus","messagePattern":"(.+?) doesn't support getAclStatus","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java","lineNumber":3226,"sourceCode":"   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public void setAcl(Path path, List<AclEntry> aclSpec) throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support setAcl\");\n  }\n\n  /**\n   * Gets the ACL of a file or directory.\n   *\n   * @param path Path to get\n   * @return AclStatus describing the ACL of the file or directory\n   * @throws IOException if an ACL could not be read\n   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public AclStatus getAclStatus(Path path) throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support getAclStatus\");\n  }\n\n  /**\n   * Set an xattr of a file or directory.\n   * The name must be prefixed with the namespace followed by \".\". For example,\n   * \"user.attr\".\n   * <p>\n   * Refer to the HDFS extended attributes user documentation for details.\n   *\n   * @param path Path to modify\n   * @param name xattr name.\n   * @param value xattr value.\n   * @throws IOException IO failure\n   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public void setXAttr(Path path, String name, byte[] value)","sourceCodeStart":3208,"sourceCodeEnd":3244,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L3208-L3244","documentation":"FileSystem.getAclStatus(Path) is optional; the base class throws UnsupportedOperationException with getClass().getSimpleName() + \" doesn't support getAclStatus\". It reads a file's ACL; implemented by DistributedFileSystem, WebHdfsFileSystem, HttpFSFileSystem, ABFS and pass-through wrappers. Local filesystem, S3A and GCS keep the throwing default.","triggerScenarios":"Calling fs.getAclStatus(path) to audit or display permissions on file://, s3a://, gs:// or har:// paths; permission-reporting tools that walk every path uniformly across a mixed-scheme lake.","commonSituations":"Compliance/audit jobs reading ACLs of datasets including non-HDFS ones; 'hdfs dfs -getfacl' style operations invoked through code on object stores.","solutions":["Probe fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) before reading","Fall back to FileStatus.getPermission()/getOwner()/getGroup() — always available — and report 'POSIX bits only'","Restrict ACL reporting to hdfs:// paths in the audit configuration","Catch UnsupportedOperationException and emit a bits-only record instead of failing the audit run"],"exampleFix":"// before\nAclStatus acls = fs.getAclStatus(path); // throws on non-ACL stores\n\n// after\nif (fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  AclStatus acls = fs.getAclStatus(path);\n} else {\n  FileStatus st = fs.getFileStatus(path);\n  reportBitsOnly(st.getOwner(), st.getGroup(), st.getPermission());\n}","handlingStrategy":"try-catch","validationCode":"if (fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  AclStatus acls = fs.getAclStatus(path);\n} else {\n  FileStatus st = fs.getFileStatus(path); // always available\n  reportBitsOnly(st);\n}","typeGuard":"static boolean supportsAclRead(FileSystem fs) {\n  return fs instanceof DistributedFileSystem\n      || fs instanceof WebHdfsFileSystem;\n}","tryCatchPattern":"try {\n  return fs.getAclStatus(path);\n} catch (UnsupportedOperationException e) {\n  return AclStatus.fromFileStatus(fs.getFileStatus(path)); // bits-only view\n}","preventionTips":["Audit tools should emit a bits-only record rather than fail on non-ACL stores","Probe FS_ACLS once per mount and cache per scheme","Prefer reading owner/group/permission from FileStatus for portable code; use getAclStatus only for the extended view"],"tags":["hadoop","filesystem","hdfs","acl","audit","unsupportedoperationexception"],"backgroundTag":"filesystem-acl-unsupported","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}