influxdata/influxdb · error · Error

Message with header of type dictionary batch could not…

Error message

Message with header of type dictionary batch could not return a dictionary batch

What it means

CouldNotGetDictionaryBatch is a unit variant of the Flight query Error enum in core/influxdb_iox_client/src/client/flight/mod.rs, raised when a FlightData message header declares it is a dictionary batch but interpreting the message as a dictionary batch returns None. Per its doc comment, this indicates malformed Flight data from the server: the header and body disagree. Decoding cannot proceed because dictionary-encoded columns cannot be resolved.

Solutions

  1. Check client and server Arrow versions for dictionary-encoding compatibility and align them.
  2. Retry the query to rule out transient stream corruption.
  3. Inspect server logs/build for known bugs emitting dictionary batches, and update the server.
  4. If persistent and reproducible, file a bug with the schema and query that triggers dictionary-encoded responses.
Defensive patterns

Strategy: try-catch

Type guard

fn is_dict_batch_failure(e: &flight::Error) -> bool {
    matches!(e, flight::Error::CouldNotGetDictionaryBatch)
}

Try / catch

match res {
    Err(flight::Error::CouldNotGetDictionaryBatch) => {
        log::error!("malformed dictionary batch from server; checking versions");
        // retry once, then escalate as a server-side bug
    }
    other => other.map_err(Into::into),
}

Prevention

When it happens

Trigger: Server emits a message whose header type says DictionaryBatch but whose body fails to parse into one; corrupt or truncated dictionary batches in a Flight stream; a server bug producing inconsistent IPC messages for dictionary-encoded columns.

Common situations: Arrow IPC writer/reader version skew around dictionary encoding; data corruption in transit for dictionary-heavy schemas; custom/patched server builds emitting malformed batches.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


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

Appendix: source

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

    #[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)]
    Deserialization(#[from] prost::DecodeError),

    /// Unknown IPC message type.
    #[error("Unknown IPC message type: {0:?}")]
    UnknownMessageType(ipc::MessageHeader),

View on GitHub (pinned to 06200ef96b)