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

  1. Always include CreateOpts.perms(FsPermission.getFileDefault()) when calling AbstractFileSystem.create directly
  2. Prefer FileContext.create, which injects and umask-applies the permission for you
  3. 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

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


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/ae9097016ebec208. Report an issue: GitHub.