{"record":{"id":"1535bf08a0340d16","repo":"influxdata/influxdb","slug":"failed-to-parse-snapshot-sequence-number-from-filename-1535bf","errorCode":null,"errorMessage":"Failed to parse snapshot sequence number from filename","messagePattern":"Failed to parse snapshot sequence number from filename","errorType":"exception","errorClass":"TableIndexCacheError","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/table_index_cache.rs","lineNumber":54,"sourceCode":"};\n\nuse thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum TableIndexCacheError {\n    #[error(\"Object store operation failed\")]\n    ObjectStore(#[source] object_store::Error),\n\n    #[error(\"JSON serialization/deserialization failed\")]\n    Json(#[source] serde_json::Error),\n\n    #[error(\"TableIndex operation failed\")]\n    TableIndex(#[source] crate::table_index::TableIndexError),\n\n    #[error(\"Object meta is missing filename\")]\n    MissingFilename,\n\n    #[error(\"Failed to parse snapshot sequence number from filename\")]\n    InvalidSnapshotSequenceNumber,\n\n    #[error(\"Unexpected error\")]\n    Unexpected(#[source] anyhow::Error),\n\n    #[error(\"Table snapshot persistence task failed\")]\n    TableSnapshotPersistenceTaskFailed(#[source] tokio::task::JoinError),\n\n    #[error(\"Failed to list table indices from object store\")]\n    ListIndices(#[source] object_store::Error),\n\n    #[error(\"Failed to parse table index path from object store path\")]\n    TableIndexPath(#[source] crate::paths::PathError),\n\n    #[error(\"Failed to list table index snapshots from object store\")]\n    ListSnapshots(#[source] object_store::Error),\n\n    #[error(\"Failed to parse table index snapshot path from object store path\")]","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/table_index_cache.rs#L36-L72","documentation":"TableIndexCacheError::InvalidSnapshotSequenceNumber is returned when the snapshot sequence number cannot be parsed from a snapshot file's name. Filenames encode an inverted sequence number (u64::MAX - seq) and if the name does not match the expected pattern, conversion of persisted snapshots cannot order or checkpoint progress.","triggerScenarios":"SnapshotInfoFilePath::parse_sequence_number returns None for the last listed snapshot meta's filename during split_persisted_snapshots_to_table_index_snapshots (table_index_cache.rs:442).","commonSituations":"Foreign or renamed files dropped into the snapshot directory (e.g. backup copies like snapshot-000123.bak, editor temp files, files from a different InfluxDB version with a different naming scheme).","solutions":["List the snapshot info prefix and remove/rename any files that do not match the canonical snapshot filename pattern.","Verify the files were produced by a compatible InfluxDB 3 version; migrate or delete files from incompatible versions.","Check for tooling (backups, sync jobs) that copies auxiliary files into the snapshot directory and exclude them.","Restart the node after cleaning so the conversion re-lists only valid snapshots."],"exampleFix":"// before: stray file snapshot-000123.bak in the snapshot dir causes parse failure\n// after: keep only canonical files\nmv snapshot-000123.bak /backup/ && influxdb3 run","handlingStrategy":"validation","validationCode":"// verify a filename matches the snapshot naming scheme before startup\nfn looks_like_snapshot(name: &str) -> bool {\n    name.starts_with(\"snapshot\") && name.split('-').last().map_or(false, |s| s.parse::<u64>().is_ok())\n}","typeGuard":"fn parse_seq(name: &str) -> Option<u64> {\n    name.rsplit('-').next()?.parse::<u64>().ok()\n}","tryCatchPattern":"match SnapshotInfoFilePath::parse_sequence_number(path) {\n    Some(seq) => use_seq(seq),\n    None => {\n        warn!(\"non-snapshot file {path} in snapshot dir; ignoring\");\n    }\n}","preventionTips":["Keep backups and editor temp files out of the snapshot directory","Enforce the canonical snapshot filename pattern in any tooling that writes there","Validate file naming after version migrations or manual restores"],"tags":["path-parsing","naming","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"}