Pumpkin-MC/Pumpkin · error · ChunkParsingError

Error deserializing chunk

Error message

Error deserializing chunk: {0}

What it means

Variant `ErrorDeserializingChunk` of `ChunkParsingError` in pumpkin-world, carrying a `String` message. It is thrown when chunk data fails to deserialize beyond the status-read step — e.g. missing sections, bad block palettes, or malformed NBT structures while rebuilding a `ChunkData` from stored NBT.

Solutions

  1. Read the embedded String message to identify which chunk component failed to deserialize
  2. Compare the chunk's NBT schema against the version pumpkin-world expects
  3. Delete/regenerate the offending chunk
Defensive patterns

Strategy: try-catch

Type guard

matches!(err, ChunkParsingError::ErrorDeserializingChunk(_))

Try / catch

match deserialize_chunk(nbt) {
    Err(ChunkParsingError::ErrorDeserializingChunk(msg)) => error!("chunk deserialization failed: {msg}"),
    other => other?,
}

Prevention

When it happens

Trigger: Converting stored chunk NBT into `ChunkSections`/`ChunkData` when section data, palettes, block entities, or heights are missing or invalid.

Common situations: Chunks written by incompatible server versions (different NBT layout), corrupted saves, third-party world editors writing nonstandard chunk data.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09). Data as JSON: /api/errors/1297b6ef2b8e9fe8. Report an issue: GitHub.

Appendix: source

Thrown at crates/pumpkin-world/src/chunk/mod.rs:927

        self.section
            .block_sections
            .read()
            .unwrap_or_else(std::sync::PoisonError::into_inner)
            .iter()
            .enumerate()
            .rev()
            .find(|(_, sub)| !sub.has_only_air())
            .map_or(0, |(idx, _)| idx)
    }
}

#[derive(Error, Debug)]
pub enum ChunkParsingError {
    #[error("Failed reading chunk status {0}")]
    FailedReadStatus(pumpkin_nbt::Error),
    #[error("The chunk isn't generated yet")]
    ChunkNotGenerated,
    #[error("Error deserializing chunk: {0}")]
    ErrorDeserializingChunk(String),
}

#[derive(Error, Debug)]
pub enum ChunkSerializingError {
    #[error("Error serializing chunk: {0}")]
    ErrorSerializingChunk(pumpkin_nbt::Error),
}

#[cfg(test)]
mod tests {
    use super::ChunkSections;
    use crate::chunk::palette::BlockPalette;
    use pumpkin_data::{Block, block_properties::has_random_ticks};

    #[test]
    fn random_tick_cache_initializes_from_palette_contents() {
        let mut sections = vec![BlockPalette::default(), BlockPalette::default()];

View on GitHub (pinned to 8d4639e25a)