Pumpkin-MC/Pumpkin · error · LoginError

Login packet data is not valid JSON

Error message

Login packet data is not valid JSON

What it means

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.

Solutions

  1. Disconnect the client with a clear kick message
  2. Log the serde error at debug level for diagnosis
  3. Ensure the client is running a compatible Bedrock protocol version
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/pumpkin/src/net/bedrock/login/mod.rs:32 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/d903212ef8b8261b. Report an issue: GitHub.

Appendix: source

Thrown at crates/pumpkin/src/net/bedrock/login/mod.rs:32

    },
    server::{login::SLogin, request_network_settings::SRequestNetworkSettings},
};
use pumpkin_protocol::bedrock::{
    client::{resource_pack_stack::PackInstanceId, resource_packs_info::PackInfoData},
    server::{login::ClientData, resource_pack_client_response::SResourcePackClientResponse},
};
use pumpkin_util::version::BedrockMinecraftVersion;
use pumpkin_world::{CURRENT_BEDROCK_MC_PROTOCOL, CURRENT_BEDROCK_MC_VERSION};
use serde::{Deserialize, de::Error};
use serde_repr::Deserialize_repr;
use std::sync::Arc;
use thiserror::Error;
use tracing::debug;
use uuid::Uuid;

#[derive(Debug, Error)]
pub enum LoginError {
    #[error("Login packet data is not valid JSON")]
    InvalidTokenFormat(#[from] serde_json::Error),
    #[error("JWT chain validation failed: {0}")]
    ChainValidationFailed(#[from] AuthError),
    #[error("The validated username is invalid")]
    InvalidUsername,
    #[error("Could not parse UUID from validated token")]
    InvalidUuid,
    #[error("Cannot accept self-signed token. Authentication is enforced by server config.")]
    SelfSignedNotAllowed,
    #[error("Got a guest/splitscreen login request. Currently unimplemented.")]
    GuestUnimplemented,
    #[error("Failed to decode extra using decode_b64_url_nopad.")]
    DecodeExtraError,
}

#[derive(Deserialize_repr)]
#[repr(u8)]
enum AuthenticationType {

View on GitHub (pinned to 8d4639e25a)