databendlabs/databend · error · InvalidInput
failed to parse seq number
Error message
failed to parse seq number: {} What it means
A validation guard in PermitKey::parse_key: the first segment of the key (the sequence number) must parse as a u64. This error fires when the leading segment before the last two slashes is not a valid unsigned integer, indicating the key was corrupted or written in a non-standard format rather than by format_key's {:020} formatting.
Solutions
- Confirm the final path segment is a base-10 u64 sequence number with no whitespace, sign, or padding characters other than the expected zero-padding.
- If the seq segment was truncated or corrupted in storage, re-encode the key with format_key.
- Strip stray characters before parsing, or reject the key at a higher level if it fails u64::from_str semantics.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/meta/plugins/semaphore/src/storage/permit_key.rs:82 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11).
Data as JSON: /api/errors/70ab361e5bbcd046.
Report an issue: GitHub.
Appendix: source
Thrown at src/meta/plugins/semaphore/src/storage/permit_key.rs:82
format!(
"semaphore permit key should have at least 3 segments: {}",
key
),
));
}
if parts[1] != "queue" {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!(
"semaphore permit key should have 'queue' as the second segment: {}",
key
),
));
}
let seq = parts[0].parse::<u64>().map_err(|e| {
io::Error::new(
io::ErrorKind::InvalidInput,
format!("failed to parse seq number: {}", e),
)
})?;
Ok(Self {
prefix: parts[2].to_string(),
seq,
})
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_display() {View on GitHub (pinned to 288d84d76e)