{"record":{"id":"5b0a5033eda7f726","repo":"FuelLabs/fuel-core","slug":"missing-column-check-the-schema","errorCode":null,"errorMessage":"Missing column. Check the schema!","messagePattern":"Missing column\\. Check the schema!","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/chain-config/src/config/state/parquet/encode.rs","lineNumber":70,"sourceCode":"                .build()\n                .expect(\"This is a valid schema\");\n\n        Type::group_type_builder(\"unimportant\")\n            .with_fields(vec![Arc::new(data)])\n            .build()\n            .expect(\"This is a valid schema\")\n    }\n}\n\nimpl<W> Encoder<W>\nwhere\n    W: Write + Send,\n{\n    pub fn write(&mut self, elements: Vec<Vec<u8>>) -> anyhow::Result<()> {\n        let mut group = self.writer.next_row_group()?;\n        let mut column = group\n            .next_column()?\n            .ok_or_else(|| anyhow::anyhow!(\"Missing column. Check the schema!\"))?;\n\n        let values = elements.into_iter().map(Into::into).collect_vec();\n        column\n            .typed::<ByteArrayType>()\n            .write_batch(&values, None, None)?;\n\n        column.close()?;\n        group.close()?;\n        Ok(())\n    }\n\n    pub fn close(self) -> anyhow::Result<()> {\n        self.writer.close()?;\n        Ok(())\n    }\n}\n","sourceCodeStart":52,"sourceCodeEnd":87,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/chain-config/src/config/state/parquet/encode.rs#L52-L87","documentation":"Encoder::write in the parquet encoder asks the row-group writer for its next column and treats None as a schema violation ('Missing column. Check the schema!', crates/chain-config/src/config/state/parquet/encode.rs:70). The encoder is created with a single byte-array column, so this error means the parquet writer yielded no column where one was guaranteed — an internal invariant break, typically writer misuse (writing after close, reusing a writer whose state advanced after a swallowed error) or a parquet-crate version mismatch.","triggerScenarios":"Calling Encoder::write(elements) after the writer's row group/column state has been consumed or closed, or with a schema that ends up with zero leaf columns.","commonSituations":"Upgrading the parquet dependency changes next_column semantics; continuing to write after a prior error was ignored; constructing the writer outside Encoder::new so the expected single-column schema is absent.","solutions":["Create a fresh Encoder per snapshot table via its constructor so the schema always contains the expected ByteArrayType column.","Propagate writer errors and never reuse an encoder after a failed write.","Pin the parquet crate to the version fuel-core chain-config was built and tested with.","If it reproduces with a freshly constructed encoder, file an upstream bug — the encoder's own schema contract was violated."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"match encoder.write(elements) {\n    Err(e) if e.to_string().contains(\"Missing column\") => {\n        // internal invariant break: discard the writer, build a fresh Encoder, and fail loudly if it repeats\n        return Err(e.context(\"parquet encoder invariant violated; recreate encoder\"));\n    }\n    other => other?,\n}","preventionTips":["Create a fresh Encoder per table via its constructor so the single-column schema is guaranteed.","Propagate every writer error; never continue writing after a failure.","Keep the parquet dependency version aligned with what chain-config was built against."],"tags":["rust","fuel-core","chain-config","parquet","encoding","schema"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}