{"record":{"id":"15961ca1add0474e","repo":"influxdata/influxdb","slug":"invalid-table-id-0","errorCode":null,"errorMessage":"Invalid table ID: {0}","messagePattern":"Invalid table ID: (.+?)","errorType":"exception","errorClass":"PathError","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/paths.rs","lineNumber":21,"sourceCode":"use 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\nfn object_store_file_stem(n: u64) -> u64 {\n    u64::MAX - n\n}","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/paths.rs#L3-L39","documentation":"PathError::InvalidTableId occurs when the table identifier component of a storage path fails validation — the component is not a well-formed table ID. Like InvalidDbId it includes the offending value and prevents malformed keys from being treated as table paths.","triggerScenarios":"Parsing object-store keys where the table segment is empty, non-numeric, or otherwise fails the table-ID validator, typically during listing/recovery scans of table data files.","commonSituations":"Manual object-store manipulation (renamed or copied directories); files from incompatible versions; corruption or truncation of keys during failed uploads/restores.","solutions":["Inspect the invalid table segment from the error and fix or delete the offending object","Avoid manual edits to object-store keys; recreate tables through the API","Confirm both producer and consumer code use the same table-ID format (numeric vs name)","Restore affected prefixes from a known-good backup if the store was corrupted"],"exampleFix":"// before\n// key: databases/12/tables/cpu/1.parquet (name 'cpu' where id expected)\n// after\n// key: databases/12/tables/42/1.parquet (valid table id)","handlingStrategy":"validation","validationCode":"fn valid_table_id(seg: &str) -> bool {\n    seg.parse::<u64>().map(|id| id > 0).unwrap_or(false)\n}","typeGuard":"fn is_valid_table_segment(s: &str) -> bool {\n    s.parse::<u64>().is_ok()\n}","tryCatchPattern":"match parse_table_path(key) {\n    Err(PathError::InvalidTableId(bad)) => {\n        log::warn!(\"invalid table id {:?} in {} — quarantining\", bad, key);\n        quarantine(key);\n        continue;\n    }\n    Ok(p) => handle(p),\n}","preventionTips":["Always obtain table IDs from the catalog rather than table names","Avoid manual copying/renaming of table directories in object storage","Scan with skip-and-log semantics so one bad key doesn't halt recovery","Keep versions consistent so table path layout matches between components"],"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"}