Pumpkin-MC/Pumpkin · error · PacketDecodeError

failed to decompress packet

Error message

failed to decompress packet: {0}

What it means

PacketDecodeError variant from the compression layer: after reading and framing a compressed packet, zlib/inflate decompression of its body failed. The offending input is the compressed payload bytes of the packet — corrupted in transit, produced by a protocol-incompatible peer, or a framing misalignment.

Solutions

  1. Disconnect the client sending corrupt compressed data
  2. Check compression threshold and settings match the client
  3. Log the decompression error at debug level
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/pumpkin-protocol/src/lib.rs:309 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at crates/pumpkin-protocol/src/lib.rs:309

    #[error("Packet exceeds maximum length: {0}")]
    TooLong(usize),
    #[error("Compression failed {0}")]
    CompressionFailed(String),
    #[error("Writing packet failed: {0}")]
    Message(String),
}

#[derive(Error, Debug)]
pub enum PacketDecodeError {
    #[error("failed to decode packet ID")]
    DecodeID,
    #[error("packet exceeds maximum length")]
    TooLong,
    #[error("packet length is out of bounds")]
    OutOfBounds,
    #[error("malformed packet length VarInt: {0}")]
    MalformedLength(String),
    #[error("failed to decompress packet: {0}")]
    FailedDecompression(String), // Updated to include error details
    #[error("packet is uncompressed but greater than the threshold")]
    NotCompressed,
    #[error("the connection has closed")]
    ConnectionClosed,
    #[error("{0}")]
    Message(String),
}

impl From<ReadingError> for PacketDecodeError {
    fn from(value: ReadingError) -> Self {
        Self::FailedDecompression(value.to_string())
    }
}

#[derive(Clone, serde::Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StatusResponse {

View on GitHub (pinned to 8d4639e25a)