{"record":{"id":"48c08a66adfab8e2","repo":"influxdata/influxdb","slug":"invalid-sequence-number-in-context-filename","errorCode":null,"errorMessage":"Invalid sequence number in {context}: {filename}","messagePattern":"Invalid sequence number in (.+?): (.+?)","errorType":"exception","errorClass":"PathError","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/paths.rs","lineNumber":24,"sourceCode":"use 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}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\npub struct ParquetFilePath(ObjPath);","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/paths.rs#L6-L42","documentation":"PathError::InvalidSequenceNumber indicates that a parquet file path or its parsed sequence number component is invalid in the given context. The write path module parses filenames like `<table_id>-<date>-<hour>-<seq>.parquet` and validates the embedded sequence number; when the component cannot be parsed as a valid u64 or is malformed, this error is returned with the offending filename and the operation context.","triggerScenarios":"Constructing or parsing a QueryDatabaseResponse / persisted parquet file path whose sequence-number segment is not a valid integer, e.g. calling paths helpers on a hand-named or corrupted file in the object store that does not follow the canonical `<uuid>-<timestamp>-<seq>.parquet` layout.","commonSituations":"Files renamed or written by external tools directly into the object store bucket; partially-uploaded parquet files left by a crashed writer; copying files across environments while altering names; older file layouts produced by previous influxdb3 versions no longer matching the current parser.","solutions":["Inspect the offending filename reported in the error and ensure it matches the canonical influxdb3 parquet naming pattern with a numeric sequence segment.","Remove or quarantine the malformed file from the object store so path parsing skips it.","Verify you are not renaming or rewriting parquet files outside of the influxdb3 writer.","Check that all nodes writing to the bucket run compatible influxdb3 versions producing the same file layout."],"exampleFix":"// before: manually copied file with broken name\nprometheus-2024-01-01-abc.parquet\n// after: canonical layout with numeric sequence\n9f2b7e1c-000001.parquet  (table uuid - nanosecond timestamp - sequence)","handlingStrategy":"validation","validationCode":"fn is_valid_parquet_name(name: &str) -> bool {\n    let base = name.strip_suffix(\".parquet\").unwrap_or(name);\n    base.split('-').last().map_or(false, |seq| seq.parse::<u64>().is_ok())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never rename or hand-edit parquet files inside the influxdb3 object-store prefix.","When scanning object storage, filter files through a name-pattern check before parsing.","Keep all influxdb3 writers on the same version so file layouts match."],"tags":["parsing","file-naming","object-store","rust"],"backgroundTag":"invalid-argument-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"}