{"record":{"id":"7f21d110cc15472a","repo":"Pumpkin-MC/Pumpkin","slug":"compression-scheme-not-recognised","errorCode":null,"errorMessage":"Compression scheme not recognised","messagePattern":"Compression scheme not recognised","errorType":"error_code","errorClass":"CompressionError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin-world/src/chunk/mod.rs","lineNumber":56,"sourceCode":"    #[error(\"Tried to read chunk which does not exist\")]\n    ChunkNotExist,\n    #[error(\"Failed to parse chunk from bytes: {0}\")]\n    ParsingError(ChunkParsingError),\n}\n\n#[derive(Error, Debug)]\npub enum ChunkWritingError {\n    #[error(\"Io error: {0}\")]\n    IoError(std::io::Error),\n    #[error(\"Compression error {0}\")]\n    Compression(CompressionError),\n    #[error(\"Chunk serializing error: {0}\")]\n    ChunkSerializingError(String),\n}\n\n#[derive(Error, Debug)]\npub enum CompressionError {\n    #[error(\"Compression scheme not recognised\")]\n    UnknownCompression,\n    #[error(\"Error while working with zlib compression: {0}\")]\n    ZlibError(std::io::Error),\n    #[error(\"Error while working with Gzip compression: {0}\")]\n    GZipError(std::io::Error),\n    #[error(\"Error while working with LZ4 compression: {0}\")]\n    LZ4Error(std::io::Error),\n    #[error(\"Error while working with zstd compression: {0}\")]\n    ZstdError(std::io::Error),\n}\n\n// Clone here cause we want to clone a snapshot of the chunk so we don't block writing for too long\npub struct ChunkData {\n    pub section: ChunkSections,\n    /// See `https://minecraft.wiki/w/Heightmap` for more info\n    pub heightmap: std::sync::Mutex<ChunkHeightmaps>,\n    pub x: i32,\n    pub z: i32,","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-world/src/chunk/mod.rs#L38-L74","documentation":"CompressionError::UnknownCompression is raised when chunk data uses a compression scheme byte that the library does not recognize. Anvil supports a fixed set (gzip, zlib, etc.); anything outside the known ids is rejected.","triggerScenarios":"Reading a chunk whose region-file compression id is unknown — e.g. data written by a newer Minecraft version using a scheme this build does not support, or a corrupt scheme byte.","commonSituations":"Worlds saved by newer game versions or mod loaders, region files edited by third-party tools, corrupted header bytes.","solutions":["Identify the scheme id in the file and confirm it is one the library supports (enable the matching crate feature, e.g. lz4 or zstd).","Upgrade the library/version to one supporting the scheme.","Recompress or convert the world with a tool to a supported scheme like zlib."],"exampleFix":"// before: assume zlib always\nlet data = decompress(bytes, Scheme::Zlib)?;\n// after\nlet scheme = Scheme::from_id(id).ok_or(CompressionError::UnknownCompression)?;\nlet data = decompress(bytes, scheme)?;","handlingStrategy":"validation","validationCode":"let id = payload.scheme_byte();\nif !SUPPORTED_SCHEMES.contains(&id) {\n    return Err(CompressionError::UnknownCompression);\n}","typeGuard":"fn is_supported_scheme(id: u8) -> bool { matches!(id, 1..=4) }","tryCatchPattern":"match read_chunk_data(bytes) {\n    Err(CompressionError::UnknownCompression) => convert_world_or_upgrade(),\n    other => other?,\n}","preventionTips":["Check the scheme byte in region headers when ingesting external worlds.","Upgrade the library before opening worlds from newer game versions.","Convert worlds to zlib before importing."],"tags":["compression","minecraft","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}