{"record":{"id":"48486fc7bfc05b9c","repo":"apache/hadoop","slug":"removedefaultacl-is-only-supported-by-storage-acco","errorCode":null,"errorMessage":"removeDefaultAcl is only supported by storage accounts with the hierarchical namespace enabled.","messagePattern":"removeDefaultAcl 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":1326,"sourceCode":"      checkException(path, ex);\n    }\n  }\n\n  /**\n   * Removes all default ACL entries from files and directories.\n   *\n   * @param path Path to modify\n   * @throws IOException if an ACL could not be modified\n   */\n  @Override\n  public void removeDefaultAcl(final Path path) throws IOException {\n    LOG.debug(\"AzureBlobFileSystem.removeDefaultAcl path: {}\", path);\n    TracingContext tracingContext = new TracingContext(clientCorrelationId,\n        fileSystemId, FSOperationType.REMOVE_DEFAULT_ACL, true,\n        tracingHeaderFormat, listener);\n\n    if (!getIsNamespaceEnabled(tracingContext)) {\n      throw new UnsupportedOperationException(\n          \"removeDefaultAcl is only supported by storage accounts with the \"\n              + \"hierarchical namespace enabled.\");\n    }\n\n    Path qualifiedPath = makeQualified(path);\n\n    try {\n      getAbfsStore().removeDefaultAcl(qualifiedPath, tracingContext);\n    } catch (AzureBlobFileSystemException ex) {\n      checkException(path, ex);\n    }\n  }\n\n  /**\n   * Removes all but the base ACL entries of files and directories.  The entries\n   * for user, group, and others are retained for compatibility with permission\n   * bits.\n   *","sourceCodeStart":1308,"sourceCodeEnd":1344,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java#L1308-L1344","documentation":"Thrown by AzureBlobFileSystem.removeDefaultAcl when the storage account does not have the hierarchical namespace enabled. Default (inheritable) ACLs only exist on HNS accounts; the driver rejects the operation client-side on flat accounts. It takes only a path, so on HNS accounts the call always proceeds to the service.","triggerScenarios":"Calling fs.removeDefaultAcl(path) against a non-HNS storage account.","commonSituations":"Directory-permission normalization jobs that clear default ACLs on trees; tools ported from HDFS that assume default ACL support everywhere; misconfigured account scheme or endpoint.","solutions":["Use an HNS-enabled account when default ACL management is required.","Guard the call with capability detection (try/catch UnsupportedOperationException).","Make the ACL-cleanup step conditional on filesystem type in job configuration."],"exampleFix":"// before\nfs.removeDefaultAcl(path);\n\n// after\ntry {\n  fs.removeDefaultAcl(path);\n} catch (UnsupportedOperationException e) {\n  LOG.debug(\"Default ACLs unsupported on this account: {}\", 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.removeDefaultAcl(path);\n} catch (UnsupportedOperationException e) {\n  LOG.debug(\"default ACLs unsupported without HNS: {}\", path);\n}","preventionTips":["Make default-ACL cleanup conditional on namespace capability.","Document the HNS requirement in tooling that walks directories.","Probe capability once and reuse the result for the whole job."],"tags":["azure-abfs","acl","hierarchical-namespace","unsupported-operation","default-acl"],"backgroundTag":"unsupported-filesystem-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}