{"id":"55dc486efd308188","repo":"sharkdp/fd","slug":"is-not-a-recognized-user-name","errorCode":null,"errorMessage":"'{}' is not a recognized user name","messagePattern":"'(.+?)' is not a recognized user name","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/filter/owner.rs","lineNumber":44,"sourceCode":"    /// Returns Ok(None) when string is acceptable but a noop (such as \"\" or \":\")\n    pub fn from_string(input: &str) -> Result<Self> {\n        let mut it = input.split(':');\n        let (fst, snd) = (it.next(), it.next());\n\n        if it.next().is_some() {\n            return Err(anyhow!(\n                \"more than one ':' present in owner string '{}'. See 'fd --help'.\",\n                input\n            ));\n        }\n\n        let uid = Check::parse(fst, |s| {\n            if let Ok(uid) = s.parse() {\n                Ok(uid)\n            } else {\n                User::from_name(s)?\n                    .map(|user| user.uid.as_raw())\n                    .ok_or_else(|| anyhow!(\"'{}' is not a recognized user name\", s))\n            }\n        })?;\n        let gid = Check::parse(snd, |s| {\n            if let Ok(gid) = s.parse() {\n                Ok(gid)\n            } else {\n                Group::from_name(s)?\n                    .map(|group| group.gid.as_raw())\n                    .ok_or_else(|| anyhow!(\"'{}' is not a recognized group name\", s))\n            }\n        })?;\n\n        Ok(OwnerFilter { uid, gid })\n    }\n\n    /// If self is a no-op (ignore both uid and gid) then return `None`, otherwise wrap in a `Some`\n    pub fn filter_ignore(self) -> Option<Self> {\n        if self == Self::IGNORE {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/sharkdp/fd/blob/41532d114e2ba565fb5367d606c111b29b96450c/src/filter/owner.rs#L26-L62","documentation":"Thrown in src/filter/owner.rs:44 during OwnerFilter::from_string. After the uid token fails to parse as a u32 integer, fd falls back to nix::unistd::User::from_name; if that lookup also returns None (no passwd entry), the name is treated as unrecognized.","triggerScenarios":"Passing 'fd --owner ghost' where 'ghost' is neither a numeric uid nor a name present in /etc/passwd (or the NSS passwd database).","commonSituations":"Typos in a username; querying a container that lacks the host's user database; LDAP/NSS user not resolvable in the current namespace; a user that was deleted.","solutions":["Verify the name resolves: 'id <name>' or 'getent passwd <name>'.","Use the numeric uid instead: 'fd --owner 1000'.","Fix NSS/passwd resolution (e.g. mount /etc/passwd, configure nsswitch/ldap) and retry."],"exampleFix":"// before\nfd --owner ghost\n\n// after\ngetent passwd ghost || fd --owner 1000","handlingStrategy":"validation","validationCode":"# resolve a uid before passing it to fd\nresolve_owner() {\n  case \"$1\" in\n    '' | *:*) printf '%s\\n' \"$1\" ;;            # already uid or uid:gid form\n    *)\n      if ! id \"$1\" >/dev/null 2>&1; then\n        echo \"unknown user: $1\" >&2; return 1\n      fi\n      printf '%s\\n' \"$1\"\n      ;;\n  esac\n}\nfd --owner \"$(resolve_owner \"$OWNER\")\"","typeGuard":"fn uid_resolves(name: &str) -> bool {\n    name.parse::<u32>().is_ok()\n        || nix::unistd::User::from_name(name).ok().flatten().is_some()\n}","tryCatchPattern":null,"preventionTips":["Run 'id <name>' or 'getent passwd <name>' before passing it to --owner.","Prefer numeric uids in automation to avoid NSS dependency.","In containers, ensure /etc/passwd is mounted/populated."],"tags":["owner-filter","parsing","unix","user-lookup"],"analyzedSha":"41532d114e2ba565fb5367d606c111b29b96450c","analyzedAt":"2026-08-06T01:39:28.509Z","schemaVersion":2}