influxdata/influxdb · error · Error

Invalid Flatbuffer

Error message

Invalid Flatbuffer: `{0}`

What it means

InvalidFlatbuffer(String) is a variant of the Flight query Error enum in core/influxdb_iox_client/src/client/flight/mod.rs, raised when data received over Arrow Flight contains invalid Flatbuffers (the binary format underlying Arrow IPC metadata). The String carries the underlying flatbuffers validation error message. It means the wire bytes could not be parsed as valid Arrow IPC metadata, i.e. the stream is corrupt or not Arrow data at all.

Solutions

  1. Capture the wrapped flatbuffers error string to identify which message/metadata failed.
  2. Check whether an intermediary (proxy, gateway) is intercepting the Flight port and returning non-Arrow payloads.
  3. Align client (arrow-rs / influxdb_iox_client) and server versions to avoid IPC format incompatibilities.
  4. Retry the request; if corruption is persistent, inspect the server's IPC writing path and network path for damage.
Defensive patterns

Strategy: retry

Validate before calling

// preflight: ensure the endpoint speaks gRPC/Flight, not HTTP error pages
client.health().await.expect("endpoint must be a Flight service");

Type guard

fn is_invalid_flatbuffer(e: &flight::Error) -> Option<&str> {
    match e {
        flight::Error::InvalidFlatbuffer(msg) => Some(msg),
        _ => None,
    }
}

Try / catch

match res {
    Err(flight::Error::InvalidFlatbuffer(msg)) if attempt < 2 => {
        log::warn!("corrupt Flight payload ({msg}); retrying");
        retry()
    }
    Err(flight::Error::InvalidFlatbuffer(msg)) => {
        // persistent corruption: check proxies/version skew
        Err(anyhow!("persistent flatbuffer corruption: {msg}"))
    }
    other => other.map_err(Into::into),
}

Prevention

When it happens

Trigger: A Flight message whose metadata flatbuffer fails validation during decode of FlightData; receiving non-Arrow bytes (e.g. an HTML error page or JSON error body) on the Flight stream; byte corruption in transit or a server writing malformed IPC.

Common situations: Proxy/gateway returning an HTTP error page on the Flight port; version skew where the server emits IPC metadata the client cannot parse; truncated streams from network middleware buffering binary data incorrectly.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/c054d3c4451dd914. Report an issue: GitHub.

Appendix: source

Thrown at core/influxdb_iox_client/src/client/flight/mod.rs:50

/// Error responses when querying an IOx namespace using the IOx Flight API.
#[derive(Debug, Error)]
pub enum Error {
    /// There were no FlightData messages returned when we expected to get one
    /// containing a Schema.
    #[error("no FlightData containing a Schema returned")]
    NoSchema,

    /// An error involving an Arrow operation occurred.
    #[error(transparent)]
    ArrowError(#[from] arrow::error::ArrowError),

    /// An error involving an Arrow Flight operation occurred.
    #[error(transparent)]
    ArrowFlightError(#[from] FlightError),

    /// The data contained invalid Flatbuffers.
    #[error("Invalid Flatbuffer: `{0}`")]
    InvalidFlatbuffer(String),

    /// The message header said it was a dictionary batch, but interpreting the
    /// message as a dictionary batch returned `None`. Indicates malformed
    /// Flight data from the server.
    #[error("Message with header of type dictionary batch could not return a dictionary batch")]
    CouldNotGetDictionaryBatch,

    /// Arrow Flight handshake failed.
    #[error("Handshake failed: {0}")]
    HandshakeFailed(String),

    /// Serializing the protobuf structs into bytes failed.
    #[error(transparent)]
    Serialization(#[from] prost::EncodeError),

    /// Deserializing the protobuf structs from bytes failed.
    #[error(transparent)]

View on GitHub (pinned to 06200ef96b)