{"record":{"id":"a917150252284695","repo":"influxdata/influxdb","slug":"failed-to-serialize-iox-metadata-0","errorCode":null,"errorMessage":"failed to serialize iox metadata: {0}","messagePattern":"failed to serialize iox metadata: (.+?)","errorType":"error_code","errorClass":"CodecError","httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/serialize.rs","lineNumber":76,"sourceCode":"\n    /// The result stream contained at least one [`RecordBatch`] and all\n    /// instances yielded by the stream contained 0 rows.\n    ///\n    /// This would result in an empty file being uploaded to object store.\n    ///\n    /// [`RecordBatch`]: arrow::record_batch::RecordBatch\n    #[error(\"no rows to serialise\")]\n    NoRows,\n\n    /// A DataFusion error during the plan execution.\n    ///\n    /// Of note: a ResourcesExhaused error likely means the buffer\n    /// used for parquet data became too large.\n    #[error(transparent)]\n    DataFusion(Box<DataFusionError>),\n\n    /// Serialising the [`IoxMetadata`] to protobuf-encoded bytes failed.\n    #[error(\"failed to serialize iox metadata: {0}\")]\n    MetadataSerialisation(#[from] prost::EncodeError),\n\n    /// Writing the parquet file failed with the specified error.\n    #[error(\"failed to build parquet file: {0}\")]\n    Writer(#[from] ParquetError),\n\n    /// Attempting to clone a handle to the provided write sink failed.\n    #[error(\"failed to obtain writer handle clone: {0}\")]\n    CloneSink(std::io::Error),\n}\n\nimpl From<CodecError> for DataFusionError {\n    fn from(value: CodecError) -> Self {\n        match value {\n            e @ (CodecError::NoRecordBatches\n            | CodecError::NoRows\n            | CodecError::MetadataSerialisation(_)\n            | CodecError::CloneSink(_)) => Self::External(Box::new(e)),","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/serialize.rs#L58-L94","documentation":"CodecError::MetadataSerialisation, a #[from] prost::EncodeError wrapper raised when protobuf-encoding the IoxMetadata (the custom IOx metadata stored alongside the Parquet data) fails. The underlying prost encode error is included in the message.","triggerScenarios":"Calling the Parquet write path where encode_to_vec/encode of the IoxMetadata protobuf message fails, e.g. prost encoding an invalid or oversized message.","commonSituations":"Prost version mismatches between generated code and the prost runtime, corrupted or hand-built IoxMetadata that violates proto invariants, or hitting internal prost encoding limits.","solutions":["Check the wrapped prost::EncodeError for the exact field that failed to encode","Ensure generated protobuf code and the prost crate version are compatible (re-generate with the matching prost-build)","Validate the IoxMetadata contents (required fields populated, no invalid enums) before writing","Upgrade prost if the encode failure is a known bug in your pinned version"],"exampleFix":"// before: mixing prost versions\ngen.prost(ProstConfig::default()); // generated with prost 0.12 while Cargo.toml pins prost 0.11\n// after: align versions\ngen.prost(ProstConfig::default()); // regenerate and pin the same prost version in Cargo.toml","handlingStrategy":"try-catch","validationCode":"// ensure metadata encodes before writing\nlet _ = iox_metadata.clone().encode_to_vec()\n    .map_err(|e| format!(\"iox metadata not encodable: {e}\"))?;","typeGuard":null,"tryCatchPattern":"match res {\n    Err(CodecError::MetadataSerialisation(e)) => {\n        error!(%e, \"protobuf encode of IoxMetadata failed; check prost version / metadata contents\")\n    }\n    other => other?,\n}","preventionTips":["Keep prost and prost-build versions aligned with generated code","Unit-test protobuf round-trip of IoxMetadata in CI","Validate required metadata fields before the write path"],"tags":["protobuf","metadata","serialization","prost"],"backgroundTag":"json-marshal-failed","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"}