{"record":{"id":"46e1edda496e3488","repo":"apache/hadoop","slug":"missing-arguments-acl-spec-path","errorCode":null,"errorMessage":"Missing arguments: <acl_spec> <path>","messagePattern":"Missing arguments: <acl_spec> <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":211,"sourceCode":"      boolean bothRemoveOptions = cf.getOpt(\"b\") && cf.getOpt(\"k\");\n      boolean bothModifyOptions = cf.getOpt(\"m\") && cf.getOpt(\"x\");\n      boolean oneRemoveOption = cf.getOpt(\"b\") || cf.getOpt(\"k\");\n      boolean oneModifyOption = cf.getOpt(\"m\") || cf.getOpt(\"x\");\n      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\");","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java#L193-L229","documentation":"Setfacl.processOptions throws HadoopIllegalArgumentException('Missing arguments: <acl_spec> <path>') when a modify or replace flag (-m, -x, or --set) was given but the remaining argument list is empty. Both the ACL spec and the path operand are mandatory for these modes.","triggerScenarios":"'hadoop fs -setfacl -m' or 'hadoop fs -setfacl --set' with nothing after the flag — args is empty after option parsing.","commonSituations":"A script's SPEC or PATH variable is unset/empty so only the mode flag survives on the command line; command assembly code that conditionally appends arguments and appends none.","solutions":["Provide both operands: hadoop fs -setfacl -m user:tom:r-- /user/tom/file.","Validate required variables before building the command: [ -n \"$SPEC\" ] && [ -n \"$P\" ] || exit 1."],"exampleFix":"# before\nhadoop fs -setfacl -m $SPEC /data   # $SPEC unset -> only '-m' remains -> throws\n\n# after\nSPEC='user:tom:r--'\nhadoop fs -setfacl -m \"$SPEC\" /data","handlingStrategy":"validation","validationCode":"[ -n \"$SPEC\" ] && [ -n \"$TARGET\" ] || { echo \"setfacl needs <acl_spec> and <path>\" >&2; exit 2; }\nhadoop fs -setfacl -m \"$SPEC\" \"$TARGET\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert both spec and path variables are non-empty before invoking setfacl."],"tags":["cli","setfacl","acl","missing-argument","hadoop"],"backgroundTag":"missing-cli-argument","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}