apache/hadoop · error · IOException

Empty user list is not allowed for RoundRobinUserResolver. P

Error message

Empty user list is not allowed for RoundRobinUserResolver. Provided user resource URI '{}' resulted in an empty user list.

What it means

RoundRobinUserResolver.setTargetUsers() parses the users resource and throws IOException (via buildEmptyUsersErrorMsg) when the resulting list is empty. Gridmix's round-robin user resolver must map simulated jobs to proxy users, so an empty user pool makes simulation impossible. The message names the offending user-resource URI so you can locate the file.

Source

Thrown at hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java:109

          ugiList.add(ugi);
        }
        // No need to parse groups, even if they exist. Go to next line
      }
    } finally {
      if (in != null) {
        in.close();
      }
    }
    return ugiList;
  }

  @Override
  public synchronized boolean setTargetUsers(URI userloc, Configuration conf)
  throws IOException {
    uidx = 0;
    users = parseUserList(userloc, conf);
    if (users.size() == 0) {
      throw new IOException(buildEmptyUsersErrorMsg(userloc));
    }
    usercache.clear();
    return true;
  }

  static String buildEmptyUsersErrorMsg(URI userloc) {
    return "Empty user list is not allowed for RoundRobinUserResolver. Provided"
    + " user resource URI '" + userloc + "' resulted in an empty user list.";
  }

  @Override
  public synchronized UserGroupInformation getTargetUgi(
    UserGroupInformation ugi) {
    // UGI of proxy user
    UserGroupInformation targetUGI = usercache.get(ugi.getUserName());
    if (targetUGI == null) {
      targetUGI = users.get(uidx++ % users.size());
      usercache.put(ugi.getUserName(), targetUGI);

View on GitHub (pinned to 2add963021)

Solutions

  1. Populate the users file with at least one line of the form 'username[,group]*' (e.g. 'hdfs,supergroup')
  2. Verify the URI in the error message is the file you intended and that it is non-empty on the machine running gridmix (wc -l / -c)
  3. If you do not need user emulation, switch the resolver: -Dgridmix.user.resolve.type=SubmittedUserResolver uses trace users and needs no users file

Example fix

# before
$ hadoop jar gridmix.jar org.apache.hadoop.mapred.gridmix.Gridmix -Dgridmix.user.resolve.type=RoundRobinUserResolver -g trace.json empty-users.txt

# after: give the file real content
$ echo 'hdfs,supergroup' > users.txt
$ printf 'alice,hdfs\nbob,analysts\n' > users.txt
$ hadoop jar gridmix.jar org.apache.hadoop.mapred.gridmix.Gridmix -g trace.json users.txt
Defensive patterns

Strategy: validation

Validate before calling

// Ensure the users resource yields at least one user before starting gridmix
List<String> lines = Files.readAllLines(Paths.get(userFile));
boolean any = lines.stream().anyMatch(l -> !l.trim().isEmpty());
if (!any) throw new IllegalStateException("Users file has no users: " + userFile);

Try / catch

try {
  resolver.setTargetUsers(uri, conf);
} catch (IOException e) {
  // empty user list — populate the file named in the message or switch resolver
}

Prevention

When it happens

Trigger: Starting gridmix with RoundRobinUserResolver (default user resolver) and a users URI whose file contains no usable lines: a zero-byte file, or only empty/whitespace lines (which parseUserList skips). Happens after parseUserList returns and users.size() == 0.

Common situations: Empty or placeholder users.txt generated by a provisioning script; a users file containing only blank lines or line breaks; pointing -g's second argument at the wrong (empty) file; truncation during transfer to the cluster.

Related errors


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