{"record":{"id":"1ba5589fd40e0ae6","repo":"influxdata/influxdb","slug":"message-with-header-of-type-dictionary-batch-could-not","errorCode":null,"errorMessage":"Message with header of type dictionary batch could not return a dictionary batch","messagePattern":"Message with header of type dictionary batch could not return a dictionary batch","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/influxdb_iox_client/src/client/flight/mod.rs","lineNumber":56,"sourceCode":"    #[error(\"no FlightData containing a Schema returned\")]\n    NoSchema,\n\n    /// An error involving an Arrow operation occurred.\n    #[error(transparent)]\n    ArrowError(#[from] arrow::error::ArrowError),\n\n    /// An error involving an Arrow Flight operation occurred.\n    #[error(transparent)]\n    ArrowFlightError(#[from] FlightError),\n\n    /// The data contained invalid Flatbuffers.\n    #[error(\"Invalid Flatbuffer: `{0}`\")]\n    InvalidFlatbuffer(String),\n\n    /// The message header said it was a dictionary batch, but interpreting the\n    /// message as a dictionary batch returned `None`. Indicates malformed\n    /// Flight data from the server.\n    #[error(\"Message with header of type dictionary batch could not return a dictionary batch\")]\n    CouldNotGetDictionaryBatch,\n\n    /// Arrow Flight handshake failed.\n    #[error(\"Handshake failed: {0}\")]\n    HandshakeFailed(String),\n\n    /// Serializing the protobuf structs into bytes failed.\n    #[error(transparent)]\n    Serialization(#[from] prost::EncodeError),\n\n    /// Deserializing the protobuf structs from bytes failed.\n    #[error(transparent)]\n    Deserialization(#[from] prost::DecodeError),\n\n    /// Unknown IPC message type.\n    #[error(\"Unknown IPC message type: {0:?}\")]\n    UnknownMessageType(ipc::MessageHeader),\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/client/flight/mod.rs#L38-L74","documentation":"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.","triggerScenarios":"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.","commonSituations":"Arrow IPC writer/reader version skew around dictionary encoding; data corruption in transit for dictionary-heavy schemas; custom/patched server builds emitting malformed batches.","solutions":["Check client and server Arrow versions for dictionary-encoding compatibility and align them.","Retry the query to rule out transient stream corruption.","Inspect server logs/build for known bugs emitting dictionary batches, and update the server.","If persistent and reproducible, file a bug with the schema and query that triggers dictionary-encoded responses."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_dict_batch_failure(e: &flight::Error) -> bool {\n    matches!(e, flight::Error::CouldNotGetDictionaryBatch)\n}","tryCatchPattern":"match res {\n    Err(flight::Error::CouldNotGetDictionaryBatch) => {\n        log::error!(\"malformed dictionary batch from server; checking versions\");\n        // retry once, then escalate as a server-side bug\n    }\n    other => other.map_err(Into::into),\n}","preventionTips":["Align Arrow writer/reader versions between client and server","Watch for dictionary-encoded schemas when reproducing","Report persistent header/body mismatches as server bugs"],"tags":["arrow","flight","rust","influxdb-iox","dictionary-encoding","malformed-data"],"backgroundTag":"unexpected-api-response-shape","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"}