apache/hadoop · error · IllegalArgumentException

Progress must not be null

Error message

Progress must not be null

What it means

Options.CreateOpts.Progress (FileSystem.create(path, CreateOpts.progresser(p), ...)) requires a non-null Progressable; null throws IllegalArgumentException because the option must reference a real progress callback.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Options.java:147

      public ChecksumOpt getValue() { return checksumOpt; }
    }
    
    public static class Perms extends CreateOpts {
      private final FsPermission permissions;
      protected Perms(FsPermission perm) { 
        if(perm == null) {
          throw new IllegalArgumentException("Permissions must not be null");
        }
        permissions = perm; 
      }
      public FsPermission getValue() { return permissions; }
    }
    
    public static class Progress extends CreateOpts {
      private final Progressable progress;
      protected Progress(Progressable prog) { 
        if(prog == null) {
          throw new IllegalArgumentException("Progress must not be null");
        }
        progress = prog;
      }
      public Progressable getValue() { return progress; }
    }
    
    public static class CreateParent extends CreateOpts {
      private final boolean createParent;
      protected CreateParent(boolean createPar) {
        createParent = createPar;}
      public boolean getValue() { return createParent; }
    }

    
    /**
     * Get an option of desired type
     * @param clazz is the desired class of the opt
     * @param opts - not null - at least one opt must be passed

View on GitHub (pinned to 2add963021)

Solutions

  1. Pass a no-op Progressable when the caller has no callback
  2. Omit the Progress option so create() uses the filesystem default
  3. Null-check optional callback parameters before building opts

Example fix

// before
CreateOpts.progress(progress);         // progress == null
// after
CreateOpts.progress(progress != null ? progress
    : new Progressable() { @Override public void progress() {} });
Defensive patterns

Strategy: validation

Validate before calling

Progressable prog = (progress != null) ? progress
    : new Progressable() { @Override public void progress() {} };
out = fs.create(p, CreateOpts.progress(prog));

Prevention

When it happens

Trigger: CreateOpts.progress(null) or new CreateOpts.Progress(null) — e.g. a helper that accepts an optional progress callback and forwards it without a null guard.

Common situations: Optional progress parameters in wrapper APIs, code paths where progress reporting is only sometimes wired up.

Related errors


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