Pumpkin-MC/Pumpkin · error

Unknown ItemStackRequestAction ID

Error message

Unknown ItemStackRequestAction ID: {action_type}

What it means

Thrown by ItemStackRequestAction::read when the action_type VarUInt does not match any known action discriminant (the catch-all match arm). Each action type id maps to a specific action struct; unknown ids indicate the packet no longer matches the implemented protocol. Parsing fails with an InvalidData error.

Solutions

  1. Update pumpkin-protocol to a version supporting the client's action ids
  2. Downgrade/pin the client to a protocol version the server supports
  3. Log the offending action_type and compare against the match arms in item_stack_request.rs to identify the missing variant
  4. Add the new action variant to the match if you maintain a fork

Example fix

// before
_ => Err(Error::new(ErrorKind::InvalidData, format!("Unknown ItemStackRequestAction ID: {action_type}"))),
// after (fork, adding a known new id)
0x53 => { let a = ItemStackRequestActionData::read(buf)?; Ok(Self::SomeNewAction(a)) }
_ => Err(Error::new(ErrorKind::InvalidData, format!("Unknown ItemStackRequestAction ID: {action_type}"))),
Defensive patterns

Strategy: validation

Validate before calling

fn known_action_id(id: u32) -> bool { id <= 0x52 } // adjust to the handled discriminant set

Type guard

fn parse_action_id(id: u32) -> Option<u8> { u8::try_from(id).ok().filter(|&i| is_handled_action(i)) }

Try / catch

match ItemStackRequestAction::read(buf) {
    Err(e) if e.to_string().starts_with("Unknown ItemStackRequestAction ID") => {
        tracing::warn!("peer sent unknown action id; likely version mismatch");
    }
    Err(e) => return Err(e),
    Ok(a) => queue(a),
}

Prevention

When it happens

Trigger: A client sends an ItemStackRequest whose action list contains an action id not handled by this decoder (e.g. a newly added action type in a newer Bedrock protocol, or a garbage/crafted value).

Common situations: Server lagging behind a Minecraft Bedrock release that introduced new stack-request action types; modified clients; fuzzed packets.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at crates/pumpkin-protocol/src/bedrock/server/item_stack_request.rs:240

            }),
            15 => Ok(Self::Loom {
                pattern_id: String::read(buf)?,
                repetitions: u8::read(buf)?,
            }),
            16 => Ok(Self::CraftNonImplemented),
            17 => {
                let result_items_len = collection_length(buf, "craft result items")?;
                let mut result_items = Vec::with_capacity(result_items_len);
                for _ in 0..result_items_len {
                    result_items.push(StackRequestItem::read(buf)?);
                }
                let times_crafted = u8::read(buf)?;
                Ok(Self::CraftResultsDeprecated {
                    result_items,
                    times_crafted,
                })
            }
            _ => Err(Error::new(
                ErrorKind::InvalidData,
                format!("Unknown ItemStackRequestAction ID: {action_type}"),
            )),
        }
    }
}

fn skip_autocraft_ingredient<R: Read>(reader: &mut R) -> Result<(), Error> {
    let descriptor_type = VarUInt::read(reader)?.0;
    let _legacy_type = u8::read(reader)?;
    match descriptor_type {
        0 => {}
        1 => {
            let _identifier = String::read(reader)?;
            let _aux = VarInt::read(reader)?;
        }
        2 => {
            let _expression = String::read(reader)?;

View on GitHub (pinned to 8d4639e25a)