{"record":{"id":"d903212ef8b8261b","repo":"Pumpkin-MC/Pumpkin","slug":"login-packet-data-is-not-valid-json","errorCode":null,"errorMessage":"Login packet data is not valid JSON","messagePattern":"Login packet data is not valid JSON","errorType":"error_code","errorClass":"LoginError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/net/bedrock/login/mod.rs","lineNumber":32,"sourceCode":"    },\n    server::{login::SLogin, request_network_settings::SRequestNetworkSettings},\n};\nuse pumpkin_protocol::bedrock::{\n    client::{resource_pack_stack::PackInstanceId, resource_packs_info::PackInfoData},\n    server::{login::ClientData, resource_pack_client_response::SResourcePackClientResponse},\n};\nuse pumpkin_util::version::BedrockMinecraftVersion;\nuse pumpkin_world::{CURRENT_BEDROCK_MC_PROTOCOL, CURRENT_BEDROCK_MC_VERSION};\nuse serde::{Deserialize, de::Error};\nuse serde_repr::Deserialize_repr;\nuse std::sync::Arc;\nuse thiserror::Error;\nuse tracing::debug;\nuse uuid::Uuid;\n\n#[derive(Debug, Error)]\npub enum LoginError {\n    #[error(\"Login packet data is not valid JSON\")]\n    InvalidTokenFormat(#[from] serde_json::Error),\n    #[error(\"JWT chain validation failed: {0}\")]\n    ChainValidationFailed(#[from] AuthError),\n    #[error(\"The validated username is invalid\")]\n    InvalidUsername,\n    #[error(\"Could not parse UUID from validated token\")]\n    InvalidUuid,\n    #[error(\"Cannot accept self-signed token. Authentication is enforced by server config.\")]\n    SelfSignedNotAllowed,\n    #[error(\"Got a guest/splitscreen login request. Currently unimplemented.\")]\n    GuestUnimplemented,\n    #[error(\"Failed to decode extra using decode_b64_url_nopad.\")]\n    DecodeExtraError,\n}\n\n#[derive(Deserialize_repr)]\n#[repr(u8)]\nenum AuthenticationType {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/bedrock/login/mod.rs#L14-L50","documentation":"Bedrock login chain data is expected to be a JSON payload, but deserialization of the raw login packet string failed. This fires when a client sends a login packet whose chain/data portion is not parseable as JSON — typically a modified client, a protocol mismatch, or corrupted/missing JWT chain data. It is a protocol-level sentinel raised by serde's de::Error during login decoding, not a world or config problem.","triggerScenarios":"Thrown at crates/pumpkin/src/net/bedrock/login/mod.rs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disconnect the client with a clear kick message","Log the serde error at debug level for diagnosis","Ensure the client is running a compatible Bedrock protocol version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}