sharkdp/fd · error · anyhow::Error
more than one ':' present in owner string
Error message
more than one ':' present in owner string '{}'. See 'fd --help'. What it means
OwnerFilter::from_string (filter/owner.rs:32) parses an --owner argument as 'uid:gid' using split(':') and rejects any input that yields a third segment. The owner grammar allows at most one colon separating an optional uid and optional gid; extra colons are unambiguously malformed rather than ambiguous.
Solutions
- Use exactly one colon: `fd --owner alice:bob` (uid:gid), or `fd --owner alice` (uid only), or `fd --owner :bob` (gid only).
- To negate, prefix a segment with '!': `fd --owner '!alice'`.
- Run `fd --help` and read the --owner section for the full grammar.
Example fix
# before fd --owner alice:bob:carol # after (single uid:gid pair) fd --owner alice:bob
Defensive patterns
Strategy: validation
Validate before calling
validate_owner() {
local v="$1"
# allow at most one ':'
case "$v" in
*:*:*) echo "too many colons"; return 1 ;;
*) fd --owner "$v" ;;
esac
} Prevention
- Pre-split uid and gid in your script and join with a single colon.
- Document the uid:gid grammar for users to prevent list-style mistakes.
- Unit-test the owner string before passing it to fd.
When it happens
Trigger: Passing `fd --owner 3:5:`, `fd --owner ::`, `fd --owner alice:bob:carol`, or any --owner value with two or more ':' characters. The third next() on the split iterator returning Some triggers the error.
Common situations: Attempting to chain multiple owner constraints in one flag (`--owner alice:bob:carol`); copy-paste artifacts with trailing colons; misunderstanding the uid:gid syntax as a list.
Related errors
- ' ' is not a recognized group name
- ' ' is not a recognized user name
- ' ' 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/3688fc95f02a337c.
Report an issue: GitHub.
Appendix: source
Thrown at src/filter/owner.rs:32
NotEq(T),
Ignore,
}
impl OwnerFilter {
const IGNORE: Self = OwnerFilter {
uid: Check::Ignore,
gid: Check::Ignore,
};
/// Parses an owner constraint
/// Returns an error if the string is invalid
/// Returns Ok(None) when string is acceptable but a noop (such as "" or ":")
pub fn from_string(input: &str) -> Result<Self> {
let mut it = input.split(':');
let (fst, snd) = (it.next(), it.next());
if it.next().is_some() {
return Err(anyhow!(
"more than one ':' present in owner string '{}'. See 'fd --help'.",
input
));
}
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 {View on GitHub (pinned to ee20f426dd)