apache/hadoop · error · HadoopIllegalArgumentException
no permission supplied
Error message
no permission supplied
What it means
After scanning the options, AbstractFileSystem.create requires a permission entry; none found throws HadoopIllegalArgumentException("no permission supplied"). FileContext.create injects a default (file default permission with umask applied) via CreateOpts.setOpt (FileContext.java:688-698), so this only bites code calling AbstractFileSystem.create directly without a CreateOpts.Perms option.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java:600
} else if (CreateOpts.Progress.class.isInstance(iOpt)) {
if (progress != null) {
throw new HadoopIllegalArgumentException(
"Progress option is set multiple times");
}
progress = ((CreateOpts.Progress) iOpt).getValue();
} else if (CreateOpts.CreateParent.class.isInstance(iOpt)) {
if (createParent != null) {
throw new HadoopIllegalArgumentException(
"CreateParent option is set multiple times");
}
createParent = ((CreateOpts.CreateParent) iOpt).getValue();
} else {
throw new HadoopIllegalArgumentException("Unkown CreateOpts of type " +
iOpt.getClass().getName());
}
}
if (permission == null) {
throw new HadoopIllegalArgumentException("no permission supplied");
}
FsServerDefaults ssDef = getServerDefaults(f);
if (ssDef.getBlockSize() % ssDef.getBytesPerChecksum() != 0) {
throw new IOException("Internal error: default blockSize is" +
" not a multiple of default bytesPerChecksum ");
}
if (blockSize == -1) {
blockSize = ssDef.getBlockSize();
}
// Create a checksum option honoring user input as much as possible.
// If bytesPerChecksum is specified, it will override the one set in
// checksumOpt. Any missing value will be filled in using the default.
ChecksumOpt defaultOpt = new ChecksumOpt(
ssDef.getChecksumType(),View on GitHub (pinned to 2add963021)
Solutions
- Always include CreateOpts.perms(FsPermission.getFileDefault()) when calling AbstractFileSystem.create directly
- Prefer FileContext.create, which injects and umask-applies the permission for you
- In shared wrappers, add the default via CreateOpts.setOpt so it also de-duplicates
Example fix
// before
afs.create(f, EnumSet.of(CreateFlag.CREATE)); // no permission supplied
// after
afs.create(f, EnumSet.of(CreateFlag.CREATE),
CreateOpts.perms(FsPermission.getFileDefault())); Defensive patterns
Strategy: validation
Validate before calling
if (CreateOpts.getOpt(CreateOpts.Perms.class, opts) == null) {
opts = CreateOpts.setOpt(CreateOpts.perms(FsPermission.getFileDefault()), opts);
}
afs.create(f, flag, opts); Prevention
- Always supply CreateOpts.perms when calling AbstractFileSystem.create directly
- Route user code through FileContext.create, which injects the default permission with umask
- Wrap direct AFS usage in helpers that guarantee the required option set
When it happens
Trigger: Direct afs.create(path, EnumSet.of(CreateFlag.CREATE), opts...) with no CreateOpts.perms(...) in opts — typically custom frameworks or test harnesses that wrap AbstractFileSystem instead of FileContext.
Common situations: Porting code from the FileSystem API (which has permission defaulting) straight to AbstractFileSystem; hand-rolled FileContext replacements that forward raw option arrays.
Related errors
- BlockSize option is set multiple times
- BufferSize option is set multiple times
- Perms option is set multiple times
- CreateParent option is set multiple times
- ReplicationFactor option is set multiple times
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/ae9097016ebec208.
Report an issue: GitHub.