{"record":{"id":"664dc11448060da7","repo":"influxdata/influxdb","slug":"unable-to-parse-as-integer-0","errorCode":null,"errorMessage":"unable to parse as integer: {0}","messagePattern":"unable to parse as integer: (.+?)","errorType":"error_code","errorClass":"IdParsingError","httpStatus":null,"severity":"error","filePath":"influxdb3_id/src/lib.rs","lineNumber":17,"sourceCode":"use serde::Deserialize;\nuse serde::Serialize;\nuse std::fmt;\nuse std::fmt::Display;\nuse std::hash::Hash;\nuse std::num::ParseIntError;\nuse std::str::FromStr;\nuse std::sync::{\n    Arc,\n    atomic::{AtomicU64, Ordering},\n};\n\nmod serialize;\npub use serialize::{SerdeVecMap, SerdeVecSet};\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"unable to parse as integer: {0}\")]\npub struct IdParsingError(#[from] ParseIntError);\n\npub trait CatalogId: Default + Hash + Eq + Copy + Ord + Serialize + Display {\n    type Integer;\n\n    const MAX: Self;\n\n    fn next(&self) -> Self;\n\n    fn checked_next(&self) -> Option<Self>;\n}\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"failed to parse as integer: {0}\")]\npub struct IdParseError(#[from] ParseIntError);\n\nmacro_rules! catalog_identifier_type {\n    ($name:ident, $ty:ty) => {","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_id/src/lib.rs#L1-L35","documentation":"`IdParsingError` in influxdb3_id is thrown when a string cannot be parsed into the integer backing a catalog ID type (e.g., u32/u64 identifiers). It wraps `ParseIntError` via `#[from]` and renders as \"unable to parse as integer: {0}\".","triggerScenarios":"Deserializing or parsing a catalog ID from a string (HTTP path parameter, config, persisted catalog data) that is not a valid integer for the target type.","commonSituations":"Passing a UUID or non-numeric identifier where a numeric catalog ID is expected; empty string; integer overflow beyond the backing type's range (e.g., value > u32::MAX).","solutions":["Confirm the identifier is a plain numeric ID in the expected type's range","Trim whitespace/URL-encoding from the input string before parsing","Use the ID exactly as returned by the API rather than reconstructing it"],"exampleFix":"// before\nlet id: NodeId = \"3f8a2b\".parse()?;\n// after\nlet id: NodeId = \"42\".parse()?;","handlingStrategy":"validation","validationCode":"// rust\nfn is_valid_id(s: &str) -> bool {\n    !s.trim().is_empty() && s.trim().chars().all(|c| c.is_ascii_digit())\n}","typeGuard":"// rust\nfn parse_node_id(s: &str) -> Option<NodeId> {\n    s.trim().parse::<NodeId>().ok()\n}","tryCatchPattern":"// rust\nmatch \"42\".parse::<NodeId>() {\n    Ok(id) => use_id(id),\n    Err(e) => eprintln!(\"bad id input: {e}\"),\n}","preventionTips":["Use IDs exactly as returned by the API","Strip whitespace/URL-encoding before parsing","Validate numeric range of the backing integer type"],"tags":["parsing","integer","identifier"],"backgroundTag":"invalid-identifier-format","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}