{"record":{"id":"9bf2648de3cd48ea","repo":"influxdata/influxdb","slug":"unexpected-error","errorCode":null,"errorMessage":"Unexpected error","messagePattern":"Unexpected error","errorType":"exception","errorClass":"TableIndexError","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/table_index.rs","lineNumber":73,"sourceCode":"    #[error(\"Failed to parse table index path from object store path\")]\n    TableIndexPath(#[source] crate::paths::PathError),\n\n    #[error(\"Failed to parse table index snapshot path from object store path\")]\n    TableIndexSnapshotPath(#[source] crate::paths::PathError),\n\n    #[error(\"Failed to update table index: join task failed\")]\n    UpdateTaskFailed(#[source] tokio::task::JoinError),\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(\"Table snapshot persistence task failed\")]\n    TableSnapshotPersistenceTaskFailed(#[source] tokio::task::JoinError),\n\n    #[error(\"Unexpected error\")]\n    Unexpected(#[source] anyhow::Error),\n\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\npub type Result<T> = std::result::Result<T, TableIndexError>;\n\n/// An partial, incremental index into a given database/table. Should not be used to make decisions\n/// regarding gen1 file retention -- instead, all snapshots should be aggregated into a full\n/// CoreTableIndex.\n///\n/// TableIndexSnapshots are expected to be created during the normal snapshotting process alongside\n/// the full process-wide database + table index.\n#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone)]","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/table_index.rs#L55-L91","documentation":"TableIndexError::Unexpected is a catch-all for errors surfaced through anyhow::Error that don't fit a specific variant. It indicates an unexpected condition anywhere in the table index pipeline (context attached via .context() is lost in the Display but retained in the source chain). Treat it as an internal bug indicator and inspect the wrapped anyhow chain.","triggerScenarios":"Any code path in table_index.rs using anyhow with '?' conversion into TableIndexError::Unexpected — e.g. unexpected type/downcast failures, configuration assembly errors, or combinators over mixed error types that don't map to a dedicated variant.","commonSituations":"Version skew between components writing/reading indices revealing unhandled shapes; bugs where an assumed-impossible state occurs (Option/Result unwrap replaced by anyhow context); plugin or extension code returning generic errors.","solutions":["Walk the anyhow source chain (source()/root_cause()) and any captured backtrace to find the root cause.","Check log output around the failure for the original context message attached to the anyhow error.","If it stems from an assumed-impossible state, file a bug with the data and stack that triggered it.","After root-causing, prefer adding a dedicated TableIndexError variant instead of letting new cases fall into Unexpected."],"exampleFix":"// before\n.do_something()\n.map_err(|e| TableIndexError::Unexpected(e.into()))?;\n// after\n.do_something()\n.map_err(|e| TableIndexError::Unexpected(e.context(\"loading index for merge\")))?;\n// and at the call site: err.root_cause() to log the real reason","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match result {\n    Err(TableIndexError::Unexpected(anyhow_err)) => {\n        error!(root_cause = %anyhow_err.root_cause(), chain = ?anyhow_err.chain(), \"unexpected table index error\");\n        // escalate to alerting; this indicates an unhandled library state\n    }\n    other => other,\n}","preventionTips":["Attach .context(...) at every anyhow conversion site so root causes are traceable.","Add dedicated TableIndexError variants for new failure modes instead of relying on Unexpected.","Log the full anyhow chain (chain()/root_cause()) on this variant.","Treat recurring Unexpected occurrences as bugs and file them with reproduction data."],"tags":["anyhow","internal","catch-all","influxdb3"],"backgroundTag":"internal-invariant-violation","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"}