{"record":{"id":"157bc49a04842794","repo":"apache/hadoop","slug":"no-such-group-group","errorCode":null,"errorMessage":"No such group:\" + group","messagePattern":"No such group:\" \\+ group","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java","lineNumber":654,"sourceCode":"    if (id == null) {\n      updateMapIncr(user, false);\n      id = uidNameMap.inverse().get(user);\n      if (id == null) {\n        throw new IOException(\"User just deleted?:\" + user);\n      }\n    }\n    return id.intValue();\n  }\n\n  synchronized public int getGid(String group) throws IOException {\n    checkAndUpdateMaps();\n\n    Integer id = gidNameMap.inverse().get(group);\n    if (id == null) {\n      updateMapIncr(group, true);\n      id = gidNameMap.inverse().get(group);\n      if (id == null) {\n        throw new IOException(\"No such group:\" + group);\n      }\n    }\n    return id.intValue();\n  }\n\n  synchronized public String getUserName(int uid, String unknown) {\n    checkAndUpdateMaps();\n    String uname = uidNameMap.get(uid);\n    if (uname == null) {\n      try {\n        updateMapIncr(uid, false);\n      } catch (Exception e) {        \n      }\n      uname = uidNameMap.get(uid);\n      if (uname == null) {     \n        LOG.warn(\"Can't find user name for uid \" + uid\n            + \". Use default user name \" + unknown);\n        uname = unknown;","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java#L636-L672","documentation":"ShellBasedIdMapping.getGid mirrors getUid for groups: it checks the cached gidNameMap, on a miss runs updateMapIncr for that group, and throws IOException('No such group:<group>') when the group still cannot be found in the OS name service or static mapping.","triggerScenarios":"Calling getGid with a group name that has no entry in /etc/group (or the NSS backend) and no static mapping entry; typical when chown/chgrp operations through the NFS gateway reference groups unknown to the gateway host.","commonSituations":"Gateway hosts not joined to the same directory as clients; groups renamed or deleted in LDAP while files still reference them; missing static mapping coverage for synthetic groups.","solutions":["Verify with 'getent group <group>' and 'id <user>' on the mapping host","Add the group to the OS, or map it via the static ID mapping file (default /etc/nfs.static.map)","Repair LDAP/NSS lookups if the group exists upstream","Ensure gateway hosts can enumerate the same directory used by clients"],"exampleFix":"# before: group 'hadoop-eng' not present on gateway host\nsudo groupadd -g 2500 hadoop-eng\n\n# or /etc/nfs.static.map entry\nhadoop-eng 2500","handlingStrategy":"validation","validationCode":"static boolean groupResolvable(String group) throws IOException {\n  Process p = new ProcessBuilder(\"getent\", \"group\", group).start();\n  try { return p.waitFor() == 0; }\n  finally { p.destroy(); }\n}\n// call before idMapping.getGid(group)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure chown/chgrp targets exist in the OS directory backing the gateway","Maintain static mapping entries for groups not in the OS","Re-check group existence after directory migrations"],"tags":["unix","group-mapping","nfs","id-mapping"],"backgroundTag":"group-resolution-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}