{"record":{"id":"0e0ffac5b3ba786e","repo":"apache/hadoop","slug":"failed-to-get-group-id-list-for-user-username","errorCode":null,"errorMessage":"failed to get group id list for user '\" + userName + \"'","messagePattern":"failed to get group id list for user '\" \\+ userName \\+ \"'","errorType":"exception","errorClass":"PartialGroupNameException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java","lineNumber":305,"sourceCode":"      throw new PartialGroupNameException(\"Does not support partial group\"\n      + \" name resolution on Windows. \" + errMessage);\n    }\n    if (groupNames.isEmpty()) {\n      throw new PartialGroupNameException(\"The user name '\" + userName\n          + \"' is not found. \" + errMessage);\n    } else {\n      LOG.warn(\"Some group names for '{}' are not resolvable. {}\",\n          userName, errMessage);\n      // attempt to partially resolve group names\n      ShellCommandExecutor partialResolver = createGroupIDExecutor(userName);\n      try {\n        partialResolver.execute();\n        return parsePartialGroupNames(\n            groupNames, partialResolver.getOutput());\n      } catch (ExitCodeException ece) {\n        // If exception is thrown trying to get group id list,\n        // something is terribly wrong, so give up.\n        throw new PartialGroupNameException(\n            \"failed to get group id list for user '\" + userName + \"'\", ece);\n      } catch (IOException ioe) {\n        String message =\n            \"Can't execute the shell command to \" +\n            \"get the list of group id for user '\" + userName + \"'\";\n        if (partialResolver.isTimedOut()) {\n          message +=\n              \" because of the command taking longer than \" +\n              \"the configured timeout: \" + timeout + \" seconds\";\n        }\n        throw new PartialGroupNameException(message, ioe);\n      }\n    }\n  }\n\n  /**\n   * Split group names into a set.\n   *","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java#L287-L323","documentation":"During partial group resolution Hadoop runs a second shell command (an 'id -G' style helper) to fetch the user's group ids. If that command executes but exits non-zero (ExitCodeException), resolution is abandoned and PartialGroupNameException('failed to get group id list for user X') wraps it. Unlike unresolvable names, a non-zero exit is treated as a broken environment, not partial data.","triggerScenarios":"The group-id helper command fails with a non-zero exit on the mapping host: the user vanished between lookups, NSS/PAM errors, permission denied reading the group database, or the backend directory rejecting the query.","commonSituations":"Broken sssd/nscd configurations, LDAP servers rate-limiting or failing, users deleted while sessions are active.","solutions":["Run 'id -G <user>' as the Hadoop service user on the mapping node and reproduce the failure","Inspect the nested ExitCodeException for the helper's stderr","Repair the name-service backend (sssd/nscd/LDAP connectivity and permissions)","If intermittent under load, tune group mapping cache settings (hadoop.security.group.mapping.*.cache secs) to reduce lookup pressure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  groups = mapping.getGroups(user);\n} catch (PartialGroupNameException e) {\n  if (e.getMessage().startsWith(\"failed to get group id list\")) {\n    // nested ExitCodeException holds helper stderr: inspect it, check NSS/LDAP health\n  }\n  throw e;\n}","preventionTips":["Run 'id -G <user>' as the Hadoop service user in host health checks","Keep sssd/nscd and LDAP connectivity monitored on mapping hosts","Cache group lookups (hadoop.security.group.mapping cache settings) to reduce pressure on flaky backends"],"tags":["unix","group-mapping","shell","exit-code"],"backgroundTag":"group-resolution-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}