sharkdp/fd · error · anyhow::Error
more than one ':' present in owner string '{}'. See 'fd --he
Error message
more than one ':' present in owner string '{}'. See 'fd --help'. What it means
Thrown by OwnerFilter::from_string in src/filter/owner.rs:32 when the --owner argument, split on ':', yields more than two segments. The owner grammar is strictly '[!]user:[!]group' — a single colon separates uid from gid; anything with two or more colons is unparseable.
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 41532d114e)
Solutions
- Use exactly one colon: 'fd --owner alice:developers'.
- Negate either side with leading '!' rather than extra colons: 'fd --owner !alice:!root'.
- Omit the side you don't care about: 'fd --owner alice' (uid only) or 'fd --owner :developers' (gid only).
Example fix
// before fd --owner 1000:1000: // after fd --owner 1000:1000
Defensive patterns
Strategy: validation
Validate before calling
if [ "$(printf '%s' "$OWNER" | tr -cd ':' | wc -c)" -gt 1 ]; then echo "--owner must contain at most one ':'" >&2; exit 1 fi fd --owner "$OWNER"
Type guard
fn has_at_most_one_colon(s: &str) -> bool {
s.matches(':').count() <= 1
} Prevention
- Validate --owner strings (uid, uid:, :gid, uid:gid) before invoking fd.
- Reject any value with more than one colon upstream.
- Document the [!]user:[!]group grammar wherever --owner is exposed.
When it happens
Trigger: Passing 'fd --owner 3:5:', 'fd --owner ::', 'fd --owner a:b:c', or any value where split(':').count() > 2.
Common situations: Typing a Windows-style drive path by mistake; copy-pasting a 'user:group:extra' triple; trying to chain multiple uid constraints in one flag.
Related errors
- '{}' is not a recognized user name
- '{}' is not a recognized group name
- '{}' is not a valid size constraint. See 'fd --help'.
- '{}' is not a valid date or duration. See 'fd --help'.
- Unable to get shell from environment
AI-assisted analysis of sharkdp/fd@41532d114e (2026-08-06).
Data as JSON: /data/errors/3688fc95f02a337c.json.
Report an issue: GitHub.