influxdata/influxdb · error · Error
unexpected
Error message
unexpected: {0:?} What it means
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.
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
Example fix
// before
Err(anyhow!("chunk not found for id {}", id)) // surfaces as unexpected
// after
return Err(Error::resource_not_found(...)); // a classified variant Defensive patterns
Strategy: try-catch
Type guard
fn is_unexpected(e: &influxdb3_write::Error) -> Option<&anyhow::Error> {
match e { influxdb3_write::Error::Anyhow(a) => Some(a), _ => None }
} Try / catch
match op().await {
Err(influxdb3_write::Error::Anyhow(a)) => {
log::error!("unexpected internal error: {:#}", a); // full context chain
// report as a bug unless the root cause is a known subsystem failure
Err(a)
}
r => r,
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- unexpected persister error
- unexpected error
- Unexpected error
- unexpected query error
- is not a valid data type, values are int64, uint64…
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/bd71f2ce9f26af5f.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_write/src/lib.rs:60
use serde::{Deserialize, Serialize};
use std::{fmt::Debug, sync::Arc};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("object store path error: {0}")]
ObjStorePath(#[from] object_store::path::Error),
#[error("write buffer error: {0}")]
WriteBuffer(#[from] write_buffer::Error),
#[error("persister error: {0}")]
Persister(#[from] persister::PersisterError),
#[error("queries not supported in compactor only mode")]
CompactorOnly,
#[error("unexpected: {0:?}")]
Anyhow(#[from] anyhow::Error),
}
pub type Result<T, E = Error> = std::result::Result<T, E>;
pub trait WriteBuffer: Bufferer + ChunkContainer + DistinctCacheManager + LastCacheManager {}
/// The buffer is for buffering data in memory and in the wal before it is persisted as parquet files in storage.
#[async_trait]
pub trait Bufferer: Debug + Send + Sync + 'static {
/// Validates the line protocol, writes it into the WAL if configured, writes it into the in memory buffer
/// and returns the result with any lines that had errors and summary statistics.
async fn write_lp(
&self,
database: DatabaseName,
lp: &str,
ingest_time: Time,
accept_partial: bool,View on GitHub (pinned to 06200ef96b)