influxdata/influxdb · error · Error
no FlightData containing a Schema returned
Error message
no FlightData containing a Schema returned
What it means
NoSchema is a variant of the Flight query Error enum in core/influxdb_iox_client/src/client/flight/mod.rs. When decoding an Arrow Flight stream, the first FlightData message must carry the Arrow schema; this error is raised when the stream ended (or contained messages) without any FlightData containing a schema, so no RecordBatches can be decoded. It indicates an empty or malformed response stream from the IOx Flight endpoint.
Solutions
- Verify the query/namespace is valid and expected to return data; treat NoSchema as 'no data returned' where that is legitimate.
- Check server logs to see whether the Flight request failed server-side and closed the stream early.
- Confirm you are connected to the correct Flight endpoint/port for the IOx namespace.
- Update client and server to matched versions if the stream is truncated due to a protocol mismatch.
Example fix
// before: assuming every query returns a schema
let batches = flight_client.query(handle).await?;
// after: handle the empty-stream case explicitly
match flight_client.query(handle).await {
Err(Error::NoSchema) => {
log::info!("query returned no schema (no data)");
Vec::new() // or return a user-friendly 'no data' result
}
other => other?,
} Defensive patterns
Strategy: fallback
Validate before calling
// sanity-check the query target before issuing the Flight request assert!(!namespace.is_empty(), "namespace required"); assert!(!sql.trim().is_empty(), "query must not be empty");
Type guard
fn is_no_schema(e: &flight::Error) -> bool {
matches!(e, flight::Error::NoSchema)
} Try / catch
match flight_client.query(handle).await {
Err(flight::Error::NoSchema) => Ok(Vec::new()), // legitimate empty result
other => other.map_err(Into::into),
} Prevention
- Treat NoSchema as 'no data' where that is a valid outcome
- Validate namespaces/tables exist before querying
- Check server logs when streams close without a schema
When it happens
Trigger: Querying an IOx namespace via the Flight API when the server returns zero FlightData messages; the stream is cut before the schema message arrives; server returns an empty stream for the requested handle/query.
Common situations: Querying data that does not exist or a table/namespace that yields no schema; server-side error swallowed and stream closed early; connecting to an endpoint that is not a Flight SQL/IOx query service.
Understand the failure class
Background: "empty response", "returned no data", "empty embeddings": what HTTP 200-with-empty-body errors mean across libraries — this error's family across 36 libraries.
Related errors
- Invalid Flatbuffer
- Message with header of type dictionary batch could not…
- An unexpected error occurred in the client library
- Error creating record batch
- Field not found in table buffer
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/1fa521245165908f.
Report an issue: GitHub.
Appendix: source
Thrown at core/influxdb_iox_client/src/client/flight/mod.rs:38
use crate::connection::Connection;
use self::query::{NoQuery, QueryBuilder};
pub mod query;
/// Re-export generated_types
pub mod generated_types {
pub use generated_types::influxdata::iox::querier::v1::*;
}
pub use ::generated_types::tonic::codec::CompressionEncoding;
/// 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")]View on GitHub (pinned to 06200ef96b)