sharkdp/fd · error · anyhow::Error
'{}' is not a recognized group name
Error message
'{}' is not a recognized group name What it means
Thrown in src/filter/owner.rs:53 during OwnerFilter::from_string. The gid token failed integer parse, then nix::unistd::Group::from_name returned None, so no group database entry matches the supplied name.
Source
Thrown at src/filter/owner.rs:53
));
}
let uid = Check::parse(fst, |s| {
if let Ok(uid) = s.parse() {
Ok(uid)
} else {
User::from_name(s)?
.map(|user| user.uid.as_raw())
.ok_or_else(|| anyhow!("'{}' is not a recognized user name", s))
}
})?;
let gid = Check::parse(snd, |s| {
if let Ok(gid) = s.parse() {
Ok(gid)
} else {
Group::from_name(s)?
.map(|group| group.gid.as_raw())
.ok_or_else(|| anyhow!("'{}' is not a recognized group name", s))
}
})?;
Ok(OwnerFilter { uid, gid })
}
/// If self is a no-op (ignore both uid and gid) then return `None`, otherwise wrap in a `Some`
pub fn filter_ignore(self) -> Option<Self> {
if self == Self::IGNORE {
None
} else {
Some(self)
}
}
pub fn matches(&self, md: &fs::Metadata) -> bool {
use std::os::unix::fs::MetadataExt;
View on GitHub (pinned to 41532d114e)
Solutions
- Verify the group: 'getent group <name>'.
- Use the numeric gid: 'fd --owner :1000'.
- Ensure /etc/group (or NSS/ldap) is populated in the runtime, then retry.
Example fix
// before fd --owner :devs // after getent group devs || fd --owner :1000
Defensive patterns
Strategy: validation
Validate before calling
if ! getent group "${GID_PART}" >/dev/null 2>&1 && ! [[ "$GID_PART" =~ ^[0-9]+$ ]]; then
echo "unknown group: $GID_PART" >&2; exit 1
fi
fd --owner ":$GID_PART" Type guard
fn gid_resolves(name: &str) -> bool {
name.parse::<u32>().is_ok()
|| nix::unistd::Group::from_name(name).ok().flatten().is_some()
} Prevention
- Validate the gid half with 'getent group' before invoking fd.
- Use numeric gids in scripts to sidestep name resolution.
- Ensure /etc/group (or NSS) is available in the runtime.
When it happens
Trigger: Passing 'fd --owner :ghost' or 'fd --owner alice:ghost' where 'ghost' is not a numeric gid and not present in /etc/group (or the NSS group database).
Common situations: Typo in group name; container missing the host's /etc/group; querying a group that only exists under a different namespace.
Related errors
- more than one ':' present in owner string '{}'. See 'fd --he
- '{}' is not a recognized user name
- '{}' is not a valid size constraint. See 'fd --help'.
- '{}' is not a valid date or duration. See 'fd --help'.
- The pattern(s) seems to only match files with a leading dot,
AI-assisted analysis of sharkdp/fd@41532d114e (2026-08-06).
Data as JSON: /data/errors/0451accf6d503f1c.json.
Report an issue: GitHub.