{"record":{"id":"1fa521245165908f","repo":"influxdata/influxdb","slug":"no-flightdata-containing-a-schema-returned","errorCode":null,"errorMessage":"no FlightData containing a Schema returned","messagePattern":"no FlightData containing a Schema returned","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/influxdb_iox_client/src/client/flight/mod.rs","lineNumber":38,"sourceCode":"use crate::connection::Connection;\n\nuse self::query::{NoQuery, QueryBuilder};\n\npub mod query;\n\n/// Re-export generated_types\npub mod generated_types {\n    pub use generated_types::influxdata::iox::querier::v1::*;\n}\n\npub use ::generated_types::tonic::codec::CompressionEncoding;\n\n/// Error responses when querying an IOx namespace using the IOx Flight API.\n#[derive(Debug, Error)]\npub enum Error {\n    /// There were no FlightData messages returned when we expected to get one\n    /// containing a Schema.\n    #[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\")]","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/client/flight/mod.rs#L20-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: assuming every query returns a schema\nlet batches = flight_client.query(handle).await?;\n// after: handle the empty-stream case explicitly\nmatch flight_client.query(handle).await {\n    Err(Error::NoSchema) => {\n        log::info!(\"query returned no schema (no data)\");\n        Vec::new() // or return a user-friendly 'no data' result\n    }\n    other => other?,\n}","handlingStrategy":"fallback","validationCode":"// sanity-check the query target before issuing the Flight request\nassert!(!namespace.is_empty(), \"namespace required\");\nassert!(!sql.trim().is_empty(), \"query must not be empty\");","typeGuard":"fn is_no_schema(e: &flight::Error) -> bool {\n    matches!(e, flight::Error::NoSchema)\n}","tryCatchPattern":"match flight_client.query(handle).await {\n    Err(flight::Error::NoSchema) => Ok(Vec::new()), // legitimate empty result\n    other => other.map_err(Into::into),\n}","preventionTips":["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"],"tags":["arrow","flight","rust","influxdb-iox","empty-stream"],"backgroundTag":"empty-api-response","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"}