apache/hadoop · error · HadoopIllegalArgumentException
<path> is missing
Error message
<path> is missing
What it means
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.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java:70
/**
* Implementing the '-getfacl' command for the the FsShell.
*/
public static class GetfaclCommand extends FsCommand {
public static String NAME = GET_FACL;
public static String USAGE = "[-R] <path>";
public static String DESCRIPTION = "Displays the Access Control Lists"
+ " (ACLs) of files and directories. If a directory has a default ACL,"
+ " then getfacl also displays the default ACL.\n"
+ " -R: List the ACLs of all files and directories recursively.\n"
+ " <path>: File or directory to list.\n";
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
CommandFormat cf = new CommandFormat(0, Integer.MAX_VALUE, "R");
cf.parse(args);
setRecursive(cf.getOpt("R"));
if (args.isEmpty()) {
throw new HadoopIllegalArgumentException("<path> is missing");
}
if (args.size() > 1) {
throw new HadoopIllegalArgumentException("Too many arguments");
}
}
@Override
protected void processPath(PathData item) throws IOException {
out.println("# file: " + item);
out.println("# owner: " + item.stat.getOwner());
out.println("# group: " + item.stat.getGroup());
FsPermission perm = item.stat.getPermission();
if (perm.getStickyBit()) {
out.println("# flags: --" +
(perm.getOtherAction().implies(FsAction.EXECUTE) ? "t" : "T"));
}
final AclStatus aclStatus;View on GitHub (pinned to 2add963021)
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.
Example fix
# before
hadoop fs -getfacl "$MAYBE_EMPTY_VAR"
# after
[ -n "$MAYBE_EMPTY_VAR" ] || { echo "error: path required" >&2; exit 1; }
hadoop fs -getfacl "$MAYBE_EMPTY_VAR" Defensive patterns
Strategy: validation
Validate before calling
[ -n "$TARGET" ] || { echo "usage: getfacl <path>" >&2; exit 2; }
hadoop fs -getfacl "$TARGET" Prevention
- Check path variables are set and non-empty before building the command.
- set -u in scripts surfaces unset variables at the source.
When it happens
Trigger: Running 'hadoop fs -getfacl' with no operands, or with only the -R flag ('hadoop fs -getfacl -R'), so args is empty after option parsing.
Common situations: 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.
Related errors
- Too many arguments
- Missing arguments: <acl_spec> <path>
- Missing either <acl_spec> or <path>
- Specified flags contains both remove and modify flags
- Missing <acl_spec> entry
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/e496483c6add53be.
Report an issue: GitHub.