{"record":{"id":"bd71f2ce9f26af5f","repo":"influxdata/influxdb","slug":"unexpected-0","errorCode":null,"errorMessage":"unexpected: {0:?}","messagePattern":"unexpected: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/lib.rs","lineNumber":60,"sourceCode":"use serde::{Deserialize, Serialize};\nuse std::{fmt::Debug, sync::Arc};\nuse thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum Error {\n    #[error(\"object store path error: {0}\")]\n    ObjStorePath(#[from] object_store::path::Error),\n\n    #[error(\"write buffer error: {0}\")]\n    WriteBuffer(#[from] write_buffer::Error),\n\n    #[error(\"persister error: {0}\")]\n    Persister(#[from] persister::PersisterError),\n\n    #[error(\"queries not supported in compactor only mode\")]\n    CompactorOnly,\n\n    #[error(\"unexpected: {0:?}\")]\n    Anyhow(#[from] anyhow::Error),\n}\n\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\npub trait WriteBuffer: Bufferer + ChunkContainer + DistinctCacheManager + LastCacheManager {}\n\n/// The buffer is for buffering data in memory and in the wal before it is persisted as parquet files in storage.\n#[async_trait]\npub trait Bufferer: Debug + Send + Sync + 'static {\n    /// Validates the line protocol, writes it into the WAL if configured, writes it into the in memory buffer\n    /// and returns the result with any lines that had errors and summary statistics.\n    async fn write_lp(\n        &self,\n        database: DatabaseName,\n        lp: &str,\n        ingest_time: Time,\n        accept_partial: bool,","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/lib.rs#L42-L78","documentation":"The Anyhow variant wraps an anyhow::Error for unexpected/unclassified errors, formatted with Debug ({0:?}) to include the full context chain. It marks failures the library did not map to a specific variant (ObjStorePath, WriteBuffer, Persister, etc.). Because it's Debug-formatted, treat it as an internal/unexpected condition worth reporting.","triggerScenarios":"Any operation in the write-buffer/persister stack returning anyhow::Error not converted to a specific variant: unexpected internal states, third-party errors bubbled via anyhow context, or bugs in glue code.","commonSituations":"Upgrading components where new inner error types appear as anyhow errors; race conditions or invariant violations surfaced as context-rich anyhow chains; plugin/extension code returning anyhow errors.","solutions":["Read the full Debug chain of the wrapped anyhow::Error — it includes backtrace and every context message","Map the root cause to the appropriate subsystem and fix or report as a bug if it indicates an invariant violation","Add proper error variants upstream so this stays classified rather than falling into anyhow","Check versions of influxdb3 crates for known fixes matching the wrapped message"],"exampleFix":"// before\nErr(anyhow!(\"chunk not found for id {}\", id)) // surfaces as unexpected\n// after\nreturn Err(Error::resource_not_found(...)); // a classified variant","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_unexpected(e: &influxdb3_write::Error) -> Option<&anyhow::Error> {\n    match e { influxdb3_write::Error::Anyhow(a) => Some(a), _ => None }\n}","tryCatchPattern":"match op().await {\n    Err(influxdb3_write::Error::Anyhow(a)) => {\n        log::error!(\"unexpected internal error: {:#}\", a); // full context chain\n        // report as a bug unless the root cause is a known subsystem failure\n        Err(a)\n    }\n    r => r,\n}","preventionTips":["Log the full anyhow chain ({:#} or {:?}) to find the root cause","Keep influxdb3 crate versions in sync across components","Classify errors at their source instead of letting them bubble as anyhow","File issues for reproducible 'unexpected' errors — they usually indicate bugs"],"tags":["rust","anyhow","unexpected"],"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"}