{"record":{"id":"9e8fba36bd7e184a","repo":"apache/hadoop","slug":"too-many-arguments","errorCode":null,"errorMessage":"Too many arguments","messagePattern":"Too many arguments","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":73,"sourceCode":"  public static class GetfaclCommand extends FsCommand {\n    public static String NAME = GET_FACL;\n    public static String USAGE = \"[-R] <path>\";\n    public static String DESCRIPTION = \"Displays the Access Control Lists\"\n        + \" (ACLs) of files and directories. If a directory has a default ACL,\"\n        + \" then getfacl also displays the default ACL.\\n\"\n        + \"  -R: List the ACLs of all files and directories recursively.\\n\"\n        + \"  <path>: File or directory to list.\\n\";\n\n    @Override\n    protected void processOptions(LinkedList<String> args) throws IOException {\n      CommandFormat cf = new CommandFormat(0, Integer.MAX_VALUE, \"R\");\n      cf.parse(args);\n      setRecursive(cf.getOpt(\"R\"));\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\n    @Override\n    protected void processPath(PathData item) throws IOException {\n      out.println(\"# file: \" + item);\n      out.println(\"# owner: \" + item.stat.getOwner());\n      out.println(\"# group: \" + item.stat.getGroup());\n      FsPermission perm = item.stat.getPermission();\n      if (perm.getStickyBit()) {\n        out.println(\"# flags: --\" +\n          (perm.getOtherAction().implies(FsAction.EXECUTE) ? \"t\" : \"T\"));\n      }\n\n      final AclStatus aclStatus;\n      final List<AclEntry> entries;\n      if (item.stat.hasAcl()) {\n        aclStatus = item.fs.getAclStatus(item.path);","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java#L55-L91","documentation":"Getfacl.processOptions throws HadoopIllegalArgumentException('Too many arguments') when more than one path operand remains after option parsing. getfacl accepts exactly one path per invocation; recursion over a tree is expressed with -R, not with multiple paths.","triggerScenarios":"'hadoop fs -getfacl /a /b'; an unquoted glob ('hadoop fs -getfacl /dir/*') that the local shell expands into multiple arguments before Hadoop parses them.","commonSituations":"Users intending recursive listing who pass several files or an expanded glob instead of -R; scripts looping constructs that accidentally pass a list as one command line.","solutions":["Pass a single path and add -R when recursion is intended: hadoop fs -getfacl -R /dir.","Loop when you truly need separate non-recursive calls: for p in /a /b; do hadoop fs -getfacl \"$p\"; done."],"exampleFix":"# before\nhadoop fs -getfacl /data/*\n\n# after\nhadoop fs -getfacl -R /data","handlingStrategy":"validation","validationCode":"if [ $# -gt 1 ]; then echo \"one path only; use -R for recursion\" >&2; exit 2; fi\nhadoop fs -getfacl \"$1\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use -R for recursive ACL listing instead of passing many paths.","Quote globs you want Hadoop (not the shell) to expand."],"tags":["cli","getfacl","acl","too-many-arguments","hadoop"],"backgroundTag":"cli-argument-count-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}