influxdata/influxdb · critical

invalid IOx metadata

Error message

invalid IOx metadata

What it means

This panic occurs in ParquetFileParams::to_parquet_file when metadata.decode() on an IoxParquetMetaData returns None, meaning the parquet file's key-value metadata does not contain valid IOx-specific metadata (the custom serialized Iox metadata expected alongside standard parquet metadata). The code treats that as an unrecoverable invariant and .expect()s with 'invalid IOx metadata'.

Solutions

  1. Ensure the parquet file was written by a compatible IOx writer version that embeds IoxParquetMetaData
  2. Regenerate/rewrite the affected parquet file (or restore from a compatible backup/catalog snapshot)
  3. If this occurs in tests, build the metadata via the proper writer path instead of constructing raw parquet metadata; file a bug if a supported file hits this

Example fix

// before
let decoded = metadata.decode().expect("invalid IOx metadata");
// after
let decoded = metadata.decode().ok_or_else(|| MetadataError::MissingIoxMetadata { path })?;
Defensive patterns

Strategy: try-catch

Validate before calling

fn has_iox_metadata(kv: &parquet::format::FileMetaData) -> bool {
    kv.key_value_metadata.as_ref().map_or(false, |kvs| kvs.iter().any(|kv| kv.key.contains("iox")))
}

Try / catch

// it is a panic, so guard before the call:
if !file_was_written_by_compatible_iox(&path) { return Err(MetadataError::MissingIoxMetadata); }
let params = to_parquet_file(&metadata, ...); // safe only for IOx-written files

Prevention

When it happens

Trigger: Calling to_parquet_file on an IoxParquetMetaData whose embedded KV metadata cannot be decoded — e.g. the file was written by an older/other writer without IOx metadata, or the metadata bytes were corrupted or written by an incompatible version.

Common situations: Reading a parquet file created before IOx metadata serialization was introduced; hand-crafted or test parquet files lacking the IOx KV entry; version skew where the decode format changed between releases.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/8bf33d932c7fccce. Report an issue: GitHub.

Appendix: source

Thrown at core/parquet_file/src/metadata.rs:452

            compaction_level: CompactionLevel::Initial,
            sort_key: None,
            max_l0_created_at: MaxL0CreatedAt::NotCompacted,
        }
    }

    /// Create a corresponding iox catalog's ParquetFile
    pub fn to_parquet_file<F>(
        &self,
        partition_id: PartitionId,
        partition_hash_id: PartitionHashId,
        file_size_bytes: u64,
        metadata: &IoxParquetMetaData,
        column_id_map: F,
    ) -> ParquetFileParams
    where
        F: for<'a> Fn(&'a str) -> ColumnId,
    {
        let decoded = metadata.decode().expect("invalid IOx metadata");
        trace!(
            ?partition_id,
            ?decoded,
            "DecodedIoxParquetMetaData decoded from its IoxParquetMetaData"
        );
        let row_count = decoded.row_count();
        if decoded.md.row_groups().is_empty() {
            debug!(
                ?partition_id,
                "Decoded IoxParquetMetaData has no row groups to provide useful statistics"
            );
        }

        // Derive the min/max timestamp from the Parquet column statistics.
        let schema = decoded
            .read_schema()
            .expect("failed to read encoded schema");
        let stats = decoded

View on GitHub (pinned to 06200ef96b)