FuelLabs/fuel-core · error

Fragments don't have the same encoding and cannot be merged.

Error message

Fragments don't have the same encoding and cannot be merged. Fragments: {a:?} and {b:?}

What it means

Fragment merging only understands (Parquet, Parquet) pairs; any other combination — e.g. a parquet fragment with a non-parquet fragment — fails with "Fragments don't have the same encoding and cannot be merged. Fragments: {a:?} and {b:?}" (crates/chain-config/src/config/state/writer.rs:193). The encodings are different container formats, so their tables cannot be concatenated. The Debug output in the message names both fragments' encodings.

Source

Thrown at crates/chain-config/src/config/state/writer.rs:193

            #[cfg(feature = "parquet")]
            (
                FragmentData::Parquet {
                    tables,
                    compression,
                },
                FragmentData::Parquet {
                    tables: their_tables,
                    compression: their_compression,
                },
            ) => {
                tables.extend(their_tables);
                anyhow::ensure!(
                    *compression == their_compression,
                    "Fragments use different compressions."
                )
            }
            #[cfg(feature = "parquet")]
            (a, b) => anyhow::bail!(
                "Fragments don't have the same encoding and cannot be merged. Fragments: {a:?} and {b:?}"
            ),
        };

        Ok(self)
    }
}

#[derive(Debug, Clone)]
pub struct SnapshotFragment {
    dir: PathBuf,
    data: FragmentData,
}

impl SnapshotFragment {
    pub fn merge(mut self, fragment: Self) -> anyhow::Result<Self> {
        self.data = self.data.merge(fragment.data)?;
        Ok(self)

View on GitHub (pinned to b9d4d170da)

Solutions

  1. Regenerate all fragments with the same encoding (parquet is the modern default).
  2. Ensure every process producing or merging fragments is built with the same feature flags (parquet enabled).
  3. Do not merge fragments across tool versions; re-encode old fragments before merging.
Defensive patterns

Strategy: validation

Try / catch

match fragment_a.merge(fragment_b) {
    Err(e) if e.to_string().contains("cannot be merged") => {
        // encodings differ (e.g. parquet vs non-parquet) → re-encode one side, then retry
        reencode_to_parquet(&fragment_b)?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: Merging a fragment written with the parquet feature against one written without it (e.g. a JSON-encoded fragment), i.e. any merge that is not Parquet+Parquet.

Common situations: Upgrading tooling so newer runs write parquet while older fragments predate the feature; binaries in the same pipeline built with different feature sets; mixing fragments from different tool versions.

Related errors


AI-assisted analysis of FuelLabs/fuel-core@b9d4d170da (2026-08-16). Data as JSON: /api/errors/62d1704319770ceb. Report an issue: GitHub.