{"record":{"id":"2b23a6052b304f43","repo":"influxdata/influxdb","slug":"failed-to-read-encoded-schema","errorCode":null,"errorMessage":"failed to read encoded schema","messagePattern":"failed to read encoded schema","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/parquet_file/src/metadata.rs","lineNumber":469,"sourceCode":"    {\n        let decoded = metadata.decode().expect(\"invalid IOx metadata\");\n        trace!(\n            ?partition_id,\n            ?decoded,\n            \"DecodedIoxParquetMetaData decoded from its IoxParquetMetaData\"\n        );\n        let row_count = decoded.row_count();\n        if decoded.md.row_groups().is_empty() {\n            debug!(\n                ?partition_id,\n                \"Decoded IoxParquetMetaData has no row groups to provide useful statistics\"\n            );\n        }\n\n        // Derive the min/max timestamp from the Parquet column statistics.\n        let schema = decoded\n            .read_schema()\n            .expect(\"failed to read encoded schema\");\n        let stats = decoded\n            .read_statistics(&schema)\n            .expect(\"invalid statistics\");\n        let columns: Vec<_> = stats.iter().map(|v| column_id_map(&v.name)).collect();\n\n        // Extract the min/max timestamps.\n        let TimestampRange {\n            min: min_time,\n            max: max_time,\n        } = derive_min_max_time(stats);\n\n        ParquetFileParams {\n            namespace_id: self.namespace_id,\n            table_id: self.table_id,\n            partition_id,\n            partition_hash_id,\n            object_store_id: self.object_store_id,\n            min_time,","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/parquet_file/src/metadata.rs#L451-L487","documentation":"Panicked during to_parquet_file when reading the Arrow schema back from the encoded Parquet metadata failed. The Parquet footer bytes could not be parsed into a valid schema, meaning the encoded metadata is corrupt, truncated, or produced by an incompatible parquet writer. This is a hard expect: the library assumes any file it just encoded has a readable schema.","triggerScenarios":"Calling to_parquet_file with metadata whose thrift-encoded footer is truncated/corrupt; passing a mutable handle whose encoded bytes were truncated at flush; a parquet crate version mismatch producing unparseable metadata.","commonSituations":"Partial writes to object storage (truncated files), hand-edited or post-processed Parquet files, version skew between the parquet crate that wrote and reads the footer.","solutions":["Regenerate the Parquet file with to_parquet_file; the source batch was likely fine and the encoded metadata is corrupt","Verify the parquet crate version used to write matches the reader (same dependency version)","Check that the object store write completed fully (compare file_size_bytes to actual object length)","If parsing externally-supplied files, use read_schema() with proper error handling instead of the expect path"],"exampleFix":"// before (library code)\nlet schema = decoded.read_schema().expect(\"failed to read encoded schema\");\n// after (caller-side validation before use)\nlet schema = decoded.read_schema().map_err(|e| { eprintln!(\"corrupt parquet footer: {e}\"); e })?;","handlingStrategy":"try-catch","validationCode":"let bytes = object_store.get(&path).await?.bytes().await?;\nif bytes.len() < 8 { return Err(anyhow!(\"truncated parquet file\")); }","typeGuard":null,"tryCatchPattern":"let schema = decoded.read_schema().map_err(|e| Error::CorruptFooter { source: e })?;","preventionTips":["Compare object length to expected file_size_bytes after writes","Use atomic/multipart writes so footers are never truncated","Pin the parquet crate version across writer and reader"],"tags":["parquet","corrupt-metadata","panic","schema"],"backgroundTag":"file-read-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"}