{"record":{"id":"4ecaf6983d46ddc7","repo":"apache/hadoop","slug":"missing-either-acl-spec-or-path","errorCode":null,"errorMessage":"Missing either <acl_spec> or <path>","messagePattern":"Missing either <acl_spec> or <path>","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":215,"sourceCode":"      boolean setOption = cf.getOpt(\"-set\");\n      boolean hasExpectedOptions = cf.getOpt(\"b\") || cf.getOpt(\"k\") ||\n          cf.getOpt(\"m\") || cf.getOpt(\"x\") || cf.getOpt(\"-set\");\n\n      if ((bothRemoveOptions || bothModifyOptions)\n          || (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(","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java#L197-L233","documentation":"Setfacl.processOptions throws HadoopIllegalArgumentException('Missing either <acl_spec> or <path>') when a modify/replace flag (-m, -x, --set) was given and exactly one argument remains after option parsing — two operands (spec, then path) are required, only one was supplied.","triggerScenarios":"'hadoop fs -setfacl -m user:tom:r--' (spec given, path forgotten) or 'hadoop fs -setfacl --set /data' (path given, spec forgotten) — either way args.size() < 2 at AclCommands.java:215.","commonSituations":"Forgetting the trailing path operand; shell quoting mistakes that merge or drop an argument; scripts where one of the two variables expands to nothing.","solutions":["Supply both operands in order: hadoop fs -setfacl -m user:tom:r-- /data.","In scripts, assert argument count before invoking: require non-empty SPEC and non-empty PATH."],"exampleFix":"# before\nhadoop fs -setfacl -m user:tom:r--\n\n# after\nhadoop fs -setfacl -m user:tom:r-- /data","handlingStrategy":"validation","validationCode":"[ $# -eq 2 ] || { echo \"usage: setfacl -m|-x|--set <acl_spec> <path>\" >&2; exit 2; }\nhadoop fs -setfacl -m \"$1\" \"$2\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mentally fix the operand order: spec first, path last, both required.","Quote the spec so colons and commas survive the shell."],"tags":["cli","setfacl","acl","missing-argument","hadoop"],"backgroundTag":"cli-argument-count-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}