{"record":{"id":"47e133e6a4bd548e","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-verify-username","errorCode":null,"errorMessage":"Failed to verify username","messagePattern":"Failed to verify username","errorType":"exception","errorClass":"AuthError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/net/authentication.rs","lineNumber":397,"sourceCode":"                last_unknown_status = Some(other);\n            }\n        }\n    }\n\n    if not_found_count > 0 {\n        Ok(None)\n    } else if let Some(status) = last_unknown_status {\n        Err(AuthError::UnknownStatusCode(status))\n    } else {\n        Err(AuthError::FailedResponse)\n    }\n}\n\n#[derive(Error, Debug)]\npub enum AuthError {\n    #[error(\"Authentication servers are down\")]\n    FailedResponse,\n    #[error(\"Failed to verify username\")]\n    UnverifiedUsername,\n    #[error(\"You are banned from Authentication servers\")]\n    Banned,\n    #[error(\"Texture Error {0}\")]\n    TextureError(TextureError),\n    #[error(\"You have disallowed actions from Authentication servers\")]\n    DisallowedAction,\n    #[error(\"Failed to parse JSON into Game Profile\")]\n    FailedParse,\n    #[error(\"Unknown Status Code {0}\")]\n    UnknownStatusCode(StatusCode),\n}\n\n#[derive(Error, Debug)]\npub enum TextureError {\n    #[error(\"Invalid URL\")]\n    InvalidURL,\n    #[error(\"Invalid URL scheme for player texture: {0}\")]","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/authentication.rs#L379-L415","documentation":"PacketDecodeError::FailedDecompression(String) is raised when zlib decompression of a compressed packet payload fails. Once compression is negotiated (Set Compression), every packet is zlib-framed; if the payload is not valid zlib data the decompressor errors and the detail string carries the underlying cause. The library also auto-wraps ReadingError into this variant via From<ReadingError>.","triggerScenarios":"Receiving a packet with compression enabled whose body is not valid zlib data; decompressor invoked on an already-plain packet; an underlying ReadingError converted through the From impl.","commonSituations":"Client and server disagree on whether compression was enabled; corrupted data from a flaky network path being interpreted as zlib; proxies/middleboxes mangling the stream.","solutions":["Confirm both sides agree on the compression state (the Set Compression packet was sent and applied).","Validate the decompressed length against the declared packet length after decompression.","Log the detail string to identify the zlib failure cause (bad header, truncated stream, etc.).","Close the connection — decompression failures indicate corrupted or hostile framing."],"exampleFix":"// before\nlet data = ZlibDecoder::new(&payload[..]).read_to_end()?;\n// after\nlet data = ZlibDecoder::new(&payload[..]).read_to_end()\n    .map_err(|e| PacketDecodeError::FailedDecompression(e.to_string()))?;","handlingStrategy":"try-catch","validationCode":"fn is_probable_zlib(data: &[u8]) -> bool {\n    data.len() >= 2 && data[0] & 0x0f == 0x08\n}","typeGuard":null,"tryCatchPattern":"match decode_packet(stream).await {\n    Err(PacketDecodeError::FailedDecompression(detail)) => {\n        error!(\"zlib failure: {detail}\");\n        // verify compression negotiation state, then close\n    }\n    Ok(p) => handle(p),\n    Err(e) => warn!(\"decode error: {e}\"),\n}","preventionTips":["Confirm the Set Compression handshake completed before expecting compressed packets.","Cross-check the decompressed size against the declared packet length.","Reconnect on decompression failure; the stream cannot be resynced.","Watch for proxies/middleboxes that alter the TCP stream contents."],"tags":["protocol","compression","zlib","packet-decoding"],"backgroundTag":"invalid-json-response","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"}