sharkdp/fd · error · anyhow::Error
' ' is not a recognized group name
Error message
'{}' is not a recognized group name What it means
The gid portion of --owner (after the colon) is parsed as a number first; on failure fd looks it up via nix::unistd::Group::from_name and errors at filter/owner.rs:53 when no matching group exists. Leading '!' is honored for negation.
Solutions
- Confirm the group: `getent group <name>`.
- Use the numeric gid: `fd --owner :1000`.
- If you meant a user, put it before the colon: `fd --owner alice` (not `:alice`).
Example fix
# before fd --owner :devs # after (verify group or use gid) getent group devs || fd --owner :1000
Defensive patterns
Strategy: validation
Validate before calling
ensure_group() {
local g="$1"
if getent group "$g" >/dev/null 2>&1; then
fd --owner ":$g"
else
fd --owner ":$(id -g)"
fi
} Prevention
- Resolve group names with `getent group` before use.
- Prefer numeric gids when portability matters.
- Remember the group goes after the colon; a bare name is treated as a uid.
When it happens
Trigger: Passing `fd --owner :nonexistentgroup`, `fd --owner alice:devs` where 'devs' is not a group, or a group name that lives in a nameservice fd cannot query.
Common situations: Typos in group names; groups removed or renamed; containers/distros with different group databases; mistaking a username for a group name.
Related errors
- ' ' is not a recognized user name
- more than one ':' present in owner string
- ' ' is not a valid date or duration. See 'fd --help'.
- ' ' is not a valid size constraint. See 'fd --help'.
- Malformed exclude pattern
AI-assisted analysis of sharkdp/fd@ee20f426dd (2026-08-09).
Data as JSON: /api/errors/0451accf6d503f1c.
Report an issue: GitHub.
Appendix: 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 ee20f426dd)