{"record":{"id":"2d7cc93a6cd98319","repo":"juicedata/juicefs","slug":"user-s-group-s-not-found-2d7cc9","errorCode":null,"errorMessage":"user(%s):group(%s) not found","messagePattern":"user\\((.+?)\\):group\\((.+?)\\) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/nfs.go","lineNumber":402,"sourceCode":"\t})\n}\n\nfunc (n *nfsStore) Chmod(path string, mode os.FileMode) error {\n\treturn n.setAttr(path, func(attr *nfs.Fattr) nfs.Sattr3 {\n\t\treturn nfs.Sattr3{\n\t\t\tMode: nfs.SetMode{\n\t\t\t\tSetIt: true,\n\t\t\t\tMode:  uint32(mode),\n\t\t\t},\n\t\t}\n\t})\n}\n\nfunc (n *nfsStore) Chown(path string, owner, group string) error {\n\tuid := utils.LookupUser(owner)\n\tgid := utils.LookupGroup(group)\n\tif uid == -1 || gid == -1 {\n\t\treturn fmt.Errorf(\"user(%s):group(%s) not found\", owner, group)\n\t}\n\treturn n.setAttr(path, func(attr *nfs.Fattr) nfs.Sattr3 {\n\t\treturn nfs.Sattr3{\n\t\t\tUID: nfs.SetUID{\n\t\t\t\tSetIt: true,\n\t\t\t\tUID:   uint32(uid),\n\t\t\t},\n\t\t\tGID: nfs.SetUID{\n\t\t\t\tSetIt: true,\n\t\t\t\tUID:   uint32(gid),\n\t\t\t},\n\t\t}\n\t})\n}\n\nfunc (n *nfsStore) Symlink(oldName, newName string) error {\n\tnewName = strings.TrimRight(newName, \"/\")\n\tp := n.path(newName)","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/nfs.go#L384-L420","documentation":"nfsStore.Chown resolves the owner and group names to uid/gid via utils.LookupUser/LookupGroup; if either lookup returns -1 (name unknown on the local system), it refuses to set attributes and reports which names were not found.","triggerScenarios":"Calling Chown on an NFS object store with an owner or group name that does not exist in the local user/group database, e.g. Chown(path, \"appuser\", \"appgroup\") where either name is missing locally.","commonSituations":"Username/group valid on the NFS server but not on the client performing the chown; typos; running in a container with a minimal /etc/passwd and /etc/group.","solutions":["Create the missing user or group on the local machine (useradd/groupadd) before chowning.","Chown using names that resolve locally, or run as a user whose database contains them.","Check /etc/passwd and /etc/group (or NSS) on the client host; in containers, add the user/group to the image."],"exampleFix":"// before\nstore.Chown(\"/a/b\", \"appuser\", \"appgroup\") // not present locally\n// after\n// on the client host:\n// sudo groupadd -g 1005 appgroup && sudo useradd -u 1005 -g appgroup appuser\nstore.Chown(\"/a/b\", \"appuser\", \"appgroup\")","handlingStrategy":"validation","validationCode":"if _, err := user.Lookup(owner); err != nil {\n\treturn fmt.Errorf(\"owner %q does not exist locally\", owner)\n}\nif _, err := user.LookupGroup(group); err != nil {\n\treturn fmt.Errorf(\"group %q does not exist locally\", group)\n}","typeGuard":null,"tryCatchPattern":"if err := store.Chown(path, owner, group); err != nil && strings.Contains(err.Error(), \"not found\") {\n\tlog.Printf(\"create user/group %s:%s locally before chown\", owner, group)\n}","preventionTips":["Provision the same users/groups on the client machine as the NFS server uses.","In containers, add required users/groups to the image.","Prefer numeric ownership where local name resolution cannot be guaranteed."],"tags":["nfs","user-lookup","permissions"],"backgroundTag":"user-not-found","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}