{"record":{"id":"e496483c6add53be","repo":"apache/hadoop","slug":"path-is-missing","errorCode":null,"errorMessage":"<path> is missing","messagePattern":"<path> is missing","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":70,"sourceCode":"  /**\n   * Implementing the '-getfacl' command for the the FsShell.\n   */\n  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;","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java#L52-L88","documentation":"Getfacl.processOptions (AclCommands.java) throws HadoopIllegalArgumentException('<path> is missing') when, after CommandFormat parsing of -R, the remaining argument list is empty. The getfacl command requires exactly one path operand; the shell command aborts before touching the filesystem.","triggerScenarios":"Running 'hadoop fs -getfacl' with no operands, or with only the -R flag ('hadoop fs -getfacl -R'), so args is empty after option parsing.","commonSituations":"Shell scripts where the path variable is unset or expands to an empty string ($MY_PATH omitted), so the flag parsing consumes everything and no path remains; CI jobs parameterized by an empty path.","solutions":["Supply exactly one path operand: hadoop fs -getfacl /user/me/data.","Guard scripts against empty variables: [ -n \"$p\" ] || { echo 'path missing'; exit 1; } before invoking the command."],"exampleFix":"# before\nhadoop fs -getfacl \"$MAYBE_EMPTY_VAR\"\n\n# after\n[ -n \"$MAYBE_EMPTY_VAR\" ] || { echo \"error: path required\" >&2; exit 1; }\nhadoop fs -getfacl \"$MAYBE_EMPTY_VAR\"","handlingStrategy":"validation","validationCode":"[ -n \"$TARGET\" ] || { echo \"usage: getfacl <path>\" >&2; exit 2; }\nhadoop fs -getfacl \"$TARGET\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check path variables are set and non-empty before building the command.","set -u in scripts surfaces unset variables at the source."],"tags":["cli","getfacl","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"}