{"record":{"id":"795ecd233ffd209f","repo":"apache/hadoop","slug":"missing-acl-spec-entry","errorCode":null,"errorMessage":"Missing <acl_spec> entry","messagePattern":"Missing <acl_spec> entry","errorType":"exception","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java","lineNumber":220,"sourceCode":"          || (oneRemoveOption && oneModifyOption)\n          || (setOption && (oneRemoveOption || oneModifyOption))) {\n        throw new HadoopIllegalArgumentException(\n            \"Specified flags contains both remove and modify flags\");\n      }\n\n      // Only -m, -x and --set expects <acl_spec>\n      if (oneModifyOption || setOption) {\n        if (args.isEmpty()) {\n          throw new HadoopIllegalArgumentException(\n              \"Missing arguments: <acl_spec> <path>\");\n        }\n        if (args.size() < 2) {\n          throw new HadoopIllegalArgumentException(\n              \"Missing either <acl_spec> or <path>\");\n        }\n        aclEntries = AclEntry.parseAclSpec(args.removeFirst(), !cf.getOpt(\"x\"));\n        if (aclEntries.isEmpty()) {\n          throw new HadoopIllegalArgumentException(\n              \"Missing <acl_spec> entry\");\n        }\n      }\n\n      if (args.isEmpty()) {\n        throw new HadoopIllegalArgumentException(\"<path> is missing\");\n      }\n      if (args.size() > 1) {\n        throw new HadoopIllegalArgumentException(\"Too many arguments\");\n      }\n\n      if (!hasExpectedOptions) {\n        throw new HadoopIllegalArgumentException(\n            \"Expected one of -b, -k, -m, -x or --set options\");\n      }\n      // In recursive mode, save a separate list of just the access ACL entries.\n      // Only directories may have a default ACL.  When a recursive operation\n      // encounters a file under the specified path, it must pass only the","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java#L202-L238","documentation":"Setfacl.processOptions throws HadoopIllegalArgumentException('Missing <acl_spec> entry') when AclEntry.parseAclSpec on the first operand returns an empty list. parseAclSpec tokenizes on commas (StringUtils.getStringCollection), so an empty string or a string of only delimiters produces zero entries — the operand was present but carried no ACL data.","triggerScenarios":"'hadoop fs -setfacl -m \"\" /path' (empty spec string) or 'hadoop fs -setfacl -m \",\" /path' (delimiters only); an unset spec variable quoted into the command as an empty string while the path is still present.","commonSituations":"Script variables that are defined but empty; templating/quoting bugs that pass '' as the spec; whitespace-only specs after trimming elsewhere.","solutions":["Provide at least one well-formed entry: user:tom:r--, group::r-x for -m/--set, or user:tom for -x (no permissions in remove mode).","Validate the spec is non-empty and matches the entry grammar before invoking the command."],"exampleFix":"# before\nSPEC=\"\"\nhadoop fs -setfacl -m \"$SPEC\" /data\n\n# after\nSPEC='user:tom:r--'\nhadoop fs -setfacl -m \"$SPEC\" /data","handlingStrategy":"validation","validationCode":"case \"$SPEC\" in\n  ''|*[!a-zA-Z0-9_:,-]*) echo \"invalid acl_spec: '$SPEC'\" >&2; exit 2;;\nesac\nhadoop fs -setfacl -m \"$SPEC\" /data","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require a non-empty, well-formed spec (user:tom:r--, group::r-x).","In -x (remove) mode, entries carry no permission part."],"tags":["cli","setfacl","acl","empty-spec","hadoop"],"backgroundTag":"invalid-acl-spec","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}