{"record":{"id":"86a1730840168487","repo":"apache/hadoop","slug":"the-aclspec-argument-is-invalid","errorCode":null,"errorMessage":"The aclSpec argument is invalid.","messagePattern":"The aclSpec argument is invalid\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java","lineNumber":1300,"sourceCode":"   * @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  /**\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","sourceCodeStart":1282,"sourceCodeEnd":1318,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java#L1282-L1318","documentation":"Thrown by AzureBlobFileSystem.removeAclEntries when the aclSpec list is null or empty (on an HNS account). There is nothing to remove, so the driver rejects the call before any service request. Distinct from the UnsupportedOperationException that fires first on non-HNS accounts.","triggerScenarios":"Calling fs.removeAclEntries(path, null) or with an empty List<AclEntry>.","commonSituations":"Computing entries-to-remove via set difference that yields an empty set; conditional ACL logic where the spec parameter is never populated; passing a parsed spec that failed silently.","solutions":["Skip the call when the list is null or empty.","Fix the diff/parse logic that produced an empty entry list.","Log the computed entry list before invoking to catch regressions."],"exampleFix":"// before\nfs.removeAclEntries(path, toRemove);\n\n// after\nif (toRemove != null && !toRemove.isEmpty()) {\n  fs.removeAclEntries(path, toRemove);\n}","handlingStrategy":"validation","validationCode":"if (aclSpec == null || aclSpec.isEmpty()) {\n  return; // nothing to remove\n}\nfs.removeAclEntries(path, aclSpec);","typeGuard":"static boolean isNonEmpty(List<AclEntry> l) {\n  return l != null && !l.isEmpty();\n}","tryCatchPattern":"try {\n  fs.removeAclEntries(path, aclSpec);\n} catch (IllegalArgumentException e) {\n  // fix the diff logic that produced an empty list\n}","preventionTips":["Compute the removal diff first and skip when empty.","Assert parseAclSpec results are non-empty before forwarding.","Unit-test ACL diff helpers with no-change inputs."],"tags":["azure-abfs","acl","illegal-argument","removeaclentries"],"backgroundTag":"missing-required-argument","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}