{"record":{"id":"076ba7ba380bcfef","repo":"apache/hadoop","slug":"empty-user-list-is-not-allowed-for-roundrobinuserr","errorCode":null,"errorMessage":"Empty user list is not allowed for RoundRobinUserResolver. Provided user resource URI '{}' resulted in an empty user list.","messagePattern":"Empty user list is not allowed for RoundRobinUserResolver\\. Provided user resource URI '(.+?)' resulted in an empty user list\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java","lineNumber":109,"sourceCode":"          ugiList.add(ugi);\n        }\n        // No need to parse groups, even if they exist. Go to next line\n      }\n    } finally {\n      if (in != null) {\n        in.close();\n      }\n    }\n    return ugiList;\n  }\n\n  @Override\n  public synchronized boolean setTargetUsers(URI userloc, Configuration conf)\n  throws IOException {\n    uidx = 0;\n    users = parseUserList(userloc, conf);\n    if (users.size() == 0) {\n      throw new IOException(buildEmptyUsersErrorMsg(userloc));\n    }\n    usercache.clear();\n    return true;\n  }\n\n  static String buildEmptyUsersErrorMsg(URI userloc) {\n    return \"Empty user list is not allowed for RoundRobinUserResolver. Provided\"\n    + \" user resource URI '\" + userloc + \"' resulted in an empty user list.\";\n  }\n\n  @Override\n  public synchronized UserGroupInformation getTargetUgi(\n    UserGroupInformation ugi) {\n    // UGI of proxy user\n    UserGroupInformation targetUGI = usercache.get(ugi.getUserName());\n    if (targetUGI == null) {\n      targetUGI = users.get(uidx++ % users.size());\n      usercache.put(ugi.getUserName(), targetUGI);","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java#L91-L127","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Populate the users file with at least one line of the form 'username[,group]*' (e.g. 'hdfs,supergroup')","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)","If you do not need user emulation, switch the resolver: -Dgridmix.user.resolve.type=SubmittedUserResolver uses trace users and needs no users file"],"exampleFix":"# before\n$ hadoop jar gridmix.jar org.apache.hadoop.mapred.gridmix.Gridmix -Dgridmix.user.resolve.type=RoundRobinUserResolver -g trace.json empty-users.txt\n\n# after: give the file real content\n$ echo 'hdfs,supergroup' > users.txt\n$ printf 'alice,hdfs\\nbob,analysts\\n' > users.txt\n$ hadoop jar gridmix.jar org.apache.hadoop.mapred.gridmix.Gridmix -g trace.json users.txt","handlingStrategy":"validation","validationCode":"// Ensure the users resource yields at least one user before starting gridmix\nList<String> lines = Files.readAllLines(Paths.get(userFile));\nboolean any = lines.stream().anyMatch(l -> !l.trim().isEmpty());\nif (!any) throw new IllegalStateException(\"Users file has no users: \" + userFile);","typeGuard":null,"tryCatchPattern":"try {\n  resolver.setTargetUsers(uri, conf);\n} catch (IOException e) {\n  // empty user list — populate the file named in the message or switch resolver\n}","preventionTips":["Check users.txt is non-empty (contains at least one non-blank line) before launching gridmix","Consider SubmittedUserResolver (-Dgridmix.user.resolve.type) when a static user pool is not needed"],"tags":["hadoop","gridmix","user-resolver","configuration","empty-list"],"backgroundTag":"empty-config-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}