{"record":{"id":"bad414b526d1758c","repo":"apache/hadoop","slug":"getaclstatus-is-only-supported-by-storage-account","errorCode":null,"errorMessage":"getAclStatus is only supported by storage account with the hierarchical namespace enabled.","messagePattern":"getAclStatus is only supported by storage account with the hierarchical namespace enabled\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java","lineNumber":1421,"sourceCode":"      checkException(path, ex);\n    }\n  }\n\n  /**\n   * Gets the ACL of a file or directory.\n   *\n   * @param path Path to get\n   * @return AbfsAclStatus describing the ACL of the file or directory\n   * @throws IOException if an ACL could not be read\n   */\n  @Override\n  public AclStatus getAclStatus(final Path path) throws IOException {\n    LOG.debug(\"AzureBlobFileSystem.getAclStatus path: {}\", path);\n    TracingContext tracingContext = new TracingContext(clientCorrelationId,\n        fileSystemId, FSOperationType.GET_ACL_STATUS, true, tracingHeaderFormat, listener);\n\n    if (!getIsNamespaceEnabled(tracingContext)) {\n      throw new UnsupportedOperationException(\n          \"getAclStatus is only supported by storage account with the \"\n              + \"hierarchical namespace enabled.\");\n    }\n\n    Path qualifiedPath = makeQualified(path);\n\n    try {\n      return getAbfsStore().getAclStatus(qualifiedPath, tracingContext);\n    } catch (AzureBlobFileSystemException ex) {\n      checkException(path, ex);\n      return null;\n    }\n  }\n\n  /**\n   * Checks if the user can access a path.  The mode specifies which access\n   * checks to perform.  If the requested permissions are granted, then the\n   * method returns normally.  If access is denied, then the method throws an","sourceCodeStart":1403,"sourceCodeEnd":1439,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java#L1403-L1439","documentation":"Thrown by AzureBlobFileSystem.getAclStatus when the storage account lacks hierarchical namespace. Reading ACLs is only defined on HNS accounts; on flat accounts there are no POSIX ACLs to return, so the driver throws UnsupportedOperationException client-side. This is the standard feature probe: many callers test getAclStatus in a try/catch to detect HNS support.","triggerScenarios":"Calling fs.getAclStatus(path) against a non-HNS ABFS account.","commonSituations":"ACL viewers/reporting tools enumerating permissions; authorization plugins reading ACLs; code assuming every FileSystem implements AclSource.","solutions":["Use an HNS-enabled account when ACL inspection is required.","Feature-detect once per filesystem via a guarded getAclStatus call and cache the result.","Fall back to getFileStatus().getPermission() for basic permission bits on flat accounts."],"exampleFix":"// before\nAclStatus acl = fs.getAclStatus(path);\n\n// after\nAclStatus acl;\ntry {\n  acl = fs.getAclStatus(path);\n} catch (UnsupportedOperationException e) {\n  acl = null; // flat account: only permission bits available\n}","handlingStrategy":"try-catch","validationCode":"static boolean isAclCapable(FileSystem fs) {\n  try {\n    fs.getAclStatus(new Path(\"/\"));\n    return true;\n  } catch (UnsupportedOperationException e) {\n    return false;\n  } catch (IOException e) {\n    return true;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  return fs.getAclStatus(path);\n} catch (UnsupportedOperationException e) {\n  return null; // flat account: only permission bits available via getFileStatus\n}","preventionTips":["Use getAclStatus-on-root as the one-time HNS feature probe.","Fall back to getFileStatus().getPermission() when ACLs are unsupported.","Do not assume every FileSystem implements AclSource."],"tags":["azure-abfs","acl","hierarchical-namespace","unsupported-operation","getaclstatus"],"backgroundTag":"unsupported-filesystem-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}