{"record":{"id":"42d7ccb2cf93d7b9","repo":"influxdata/influxdb","slug":"invalid-database-id-0","errorCode":null,"errorMessage":"Invalid database ID: {0}","messagePattern":"Invalid database ID: (.+?)","errorType":"exception","errorClass":"PathError","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/paths.rs","lineNumber":18,"sourceCode":"use crate::YearMonth;\nuse chrono::prelude::*;\nuse influxdb3_id::{DbId, TableId, TableIndexId};\nuse influxdb3_wal::{SnapshotSequenceNumber, WalFileSequenceNumber};\nuse object_store::path::Path as ObjPath;\nuse regex::Regex;\nuse std::ops::Deref;\nuse std::str::FromStr;\nuse std::sync::{Arc, LazyLock};\nuse thiserror::Error;\n\n/// Errors that can occur when parsing paths\n#[derive(Debug, Error)]\npub enum PathError {\n    #[error(\"Invalid path format: expected {expected}, got: {actual}\")]\n    InvalidFormat { expected: String, actual: String },\n\n    #[error(\"Invalid database ID: {0}\")]\n    InvalidDbId(String),\n\n    #[error(\"Invalid table ID: {0}\")]\n    InvalidTableId(String),\n\n    #[error(\"Invalid sequence number in {context}: {filename}\")]\n    InvalidSequenceNumber { context: String, filename: String },\n}\n\n/// File extension for parquet files\npub const PARQUET_FILE_EXTENSION: &str = \"parquet\";\n\n/// File extension for snapshot info files\npub const SNAPSHOT_INFO_FILE_EXTENSION: &str = \"info.json\";\n\n/// File extension for checkpoint files\npub const CHECKPOINT_FILE_EXTENSION: &str = \"checkpoint.json\";\n","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/paths.rs#L1-L36","documentation":"PathError::InvalidDbId occurs when parsing the database identifier component of a storage path and the component is not a valid database ID (or expected identifier form). The offending text is included in the message. It protects against silently accepting malformed keys as database paths.","triggerScenarios":"Parsing a path whose database segment fails ID validation — e.g. non-numeric where a numeric DB id is expected, empty segment, or an arbitrary name where an ID is required.","commonSituations":"Manually renaming/moving folders inside the object store bucket; partially deleted catalogs leaving inconsistent keys; test objects with placeholder names like \"my-db\" where an ID is expected.","solutions":["Check the offending segment in the error message and correct or remove that object","Regenerate/rebuild the affected metadata via normal API calls instead of manual object-store edits","Verify ID parsing code matches the current path scheme (name vs numeric id)","Restore the bucket subtree from a consistent backup if keys were corrupted"],"exampleFix":"// before\n// object key: databases/my-db/... (name where numeric id expected)\n// after\n// use the catalog to look up the id and keep keys as databases/<id>/...","handlingStrategy":"validation","validationCode":"fn valid_db_id(seg: &str) -> bool {\n    !seg.is_empty() && seg.bytes().all(|b| b.is_ascii_digit())\n}","typeGuard":"fn is_numeric_id(s: &str) -> bool {\n    !s.is_empty() && s.chars().all(|c| c.is_ascii_digit())\n}","tryCatchPattern":"match parse_db_path(key) {\n    Err(PathError::InvalidDbId(bad)) => {\n        log::warn!(\"bad db id {:?} in {}; skipping\", bad, key);\n        None // skip instead of aborting the scan\n    }\n    Ok(p) => Some(p),\n}","preventionTips":["Look up database IDs via the catalog API, never derive them from names","Do not rename or move directories directly in the object store","Validate identifiers at write time so bad keys never enter storage","Restore corrupted prefixes from backups rather than editing keys by hand"],"tags":["rust","path","parsing"],"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"}