{"record":{"id":"d68c8e901b882c07","repo":"apache/hadoop","slug":"removeaclentries-is-only-supported-by-storage-acco","errorCode":null,"errorMessage":"removeAclEntries is only supported by storage accounts with the hierarchical namespace enabled.","messagePattern":"removeAclEntries is only supported by storage accounts 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":1294,"sourceCode":"\n  /**\n   * Removes ACL entries from files and directories.  Other ACL entries are\n   * retained.\n   *\n   * @param path    Path to modify\n   * @param aclSpec List of AclEntry describing entries to remove\n   * @throws IOException if an ACL could not be modified\n   */\n  @Override\n  public void removeAclEntries(final Path path, final List<AclEntry> aclSpec)\n      throws IOException {\n    LOG.debug(\"AzureBlobFileSystem.removeAclEntries path: {}\", path);\n    TracingContext tracingContext = new TracingContext(clientCorrelationId,\n        fileSystemId, FSOperationType.REMOVE_ACL_ENTRIES, true,\n        tracingHeaderFormat, listener);\n\n    if (!getIsNamespaceEnabled(tracingContext)) {\n      throw new UnsupportedOperationException(\n          \"removeAclEntries is only supported by storage accounts with the \"\n              + \"hierarchical namespace enabled.\");\n    }\n\n    if (aclSpec == null || aclSpec.isEmpty()) {\n      throw new IllegalArgumentException(\"The aclSpec argument is invalid.\");\n    }\n\n    Path qualifiedPath = makeQualified(path);\n\n    try {\n      getAbfsStore().removeAclEntries(qualifiedPath, aclSpec, tracingContext);\n    } catch (AzureBlobFileSystemException ex) {\n      checkException(path, ex);\n    }\n  }\n\n  /**","sourceCodeStart":1276,"sourceCodeEnd":1312,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java#L1276-L1312","documentation":"Thrown by AzureBlobFileSystem.removeAclEntries when the storage account lacks the hierarchical namespace (HNS). Removing individual ACL entries is only defined for HNS accounts with POSIX ACLs; flat-namespace accounts cannot honor it, so the driver fails fast client-side. Namespace state is cached after first resolution.","triggerScenarios":"Calling fs.removeAclEntries(path, entries) against a non-HNS (flat namespace) storage account.","commonSituations":"Running ACL cleanup tooling (e.g., dfsadmin-style scripts, ranger policies) against a blob account without HNS; environment config pointing to an older account; migration from wasb:// where ACLs were silently unsupported.","solutions":["Use an HNS-enabled storage account for ACL workflows.","Disable or gate ACL management features in the calling tool on flat accounts.","Catch UnsupportedOperationException and treat ACLs as unsupported for that mount."],"exampleFix":"// before\nfs.removeAclEntries(path, entries);\n\n// after\ntry {\n  fs.removeAclEntries(path, entries);\n} catch (UnsupportedOperationException e) {\n  LOG.warn(\"removeAclEntries unsupported without hierarchical namespace: {}\", path);\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  fs.removeAclEntries(path, entries);\n} catch (UnsupportedOperationException e) {\n  LOG.debug(\"removeAclEntries unsupported on non-HNS account: {}\", path);\n}","preventionTips":["Run ACL tools only against HNS accounts.","Surface the account's namespace state in tool startup diagnostics.","Treat UnsupportedOperationException as a capability signal, not a failure to retry."],"tags":["azure-abfs","acl","hierarchical-namespace","unsupported-operation"],"backgroundTag":"unsupported-filesystem-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}