{"record":{"id":"7c62a6af7c8c1ec7","repo":"apache/hadoop","slug":"user-just-deleted-user","errorCode":null,"errorMessage":"User just deleted?:\" + user","messagePattern":"User just deleted\\?:\" \\+ user","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java","lineNumber":640,"sourceCode":"          gidMapping.put(localId, remoteId);\n        }\n      }\n    } finally {\n      in.close();\n    }\n    \n    return new StaticMapping(uidMapping, gidMapping);\n  }\n\n  synchronized public int getUid(String user) throws IOException {\n    checkAndUpdateMaps();\n\n    Integer id = uidNameMap.inverse().get(user);\n    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  }","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java#L622-L658","documentation":"ShellBasedIdMapping.getUid looks the user up in the cached bidirectional uidNameMap; on a miss it calls updateMapIncr, which shells out for that single user, then retries the map. If the user is still absent, it throws IOException('User just deleted?:<user>'), meaning the OS name service (plus any static mapping) has no uid for the name.","triggerScenarios":"Requesting getUid for a user that does not exist on the host (typical for NFS gateway requests carrying remote usernames), a user deleted between the full map refresh and the lookup, or a user covered by neither passwd nor the static ID mapping file.","commonSituations":"NFS gateway clients accessing HDFS as users absent from the gateway host; intermittent LDAP/NSS failures making a real user unresolvable; users removed while sessions are active.","solutions":["Verify the user resolves on the node: 'id -u <user>' and 'getent passwd <user>'","If the user legitimately does not exist locally, add a static mapping entry in the static ID mapping file (default /etc/nfs.static.map)","Fix LDAP/NSS connectivity if the user exists upstream but not locally","Retry after the mapping cache timeout if the user was created moments ago"],"exampleFix":"# /etc/nfs.static.map (uid 1001 remote -> local uid 1001 mapping style)\n# before: file absent, user 'nfsuser' unknown to the host\n# after:\nnfsuser 1001","handlingStrategy":"validation","validationCode":"static boolean userResolvable(String user) throws IOException {\n  Process p = new ProcessBuilder(\"id\", \"-u\", user).start();\n  try { return p.waitFor() == 0; }\n  finally { p.destroy(); }\n}\n// call before idMapping.getUid(user) for foreign usernames","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep gateway hosts joined to the same directory as clients","Use a static ID mapping file for synthetic or external users","Validate usernames at protocol entry points before they reach ID mapping"],"tags":["unix","user-mapping","nfs","id-mapping"],"backgroundTag":"user-resolution-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}