{"record":{"id":"92c2dc44b782f6b5","repo":"Pumpkin-MC/Pumpkin","slug":"invalid-containername-id-value","errorCode":null,"errorMessage":"Invalid ContainerName ID: {value}","messagePattern":"Invalid ContainerName ID: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/pumpkin-protocol/src/bedrock/network_item.rs","lineNumber":496,"sourceCode":"            49 => Ok(Self::Trade2ResultPreview),\n            50 => Ok(Self::GrindstoneInput),\n            51 => Ok(Self::GrindstoneAdditional),\n            52 => Ok(Self::GrindstoneResultPreview),\n            53 => Ok(Self::StonecutterInput),\n            54 => Ok(Self::StonecutterResultPreview),\n            55 => Ok(Self::CartographyInput),\n            56 => Ok(Self::CartographyAdditional),\n            57 => Ok(Self::CartographyResultPreview),\n            58 => Ok(Self::Barrel),\n            59 => Ok(Self::Cursor),\n            60 => Ok(Self::CreatedOutput),\n            61 => Ok(Self::SmithingTableTemplate),\n            62 => Ok(Self::CrafterLevelEntity),\n            63 => Ok(Self::Dynamic),\n            64 => Ok(Self::RecipeFood),\n            65 => Ok(Self::RecipeBlocks),\n            66 => Ok(Self::RecipeFurnaceItems),\n            _ => Err(Error::new(\n                std::io::ErrorKind::InvalidData,\n                format!(\"Invalid ContainerName ID: {value}\"),\n            )),\n        }\n    }\n}\n\nimpl PacketWrite for ContainerName {\n    fn write<W: Write>(&self, writer: &mut W) -> Result<(), Error> {\n        (*self as u8).write(writer)?;\n        Ok(())\n    }\n}\n\nimpl PacketRead for ContainerName {\n    fn read<R: Read>(buf: &mut R) -> Result<Self, Error> {\n        let value = u8::read(buf)?;\n        Self::try_from(value)","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-protocol/src/bedrock/network_item.rs#L478-L514","documentation":"Returned by ContainerName::try_from/decode when the incoming varint ID does not map to any known ContainerName variant (valid IDs currently run 0..=66). The parser fails with InvalidData rather than inventing an unknown container variant.","triggerScenarios":"Decoding a Bedrock packet that carries a ContainerName ID outside the recognized 0-66 range — newer/older client sending an ID this server build doesn't know, or stream desync producing a garbage value.","commonSituations":"Client on a newer Bedrock version introduces container IDs unknown to this server; corrupt packet misaligned so random bytes parse as the ID.","solutions":["Update the server/protocol crate to a version that maps the new ContainerName IDs.","Check client version compatibility; pin or reject clients with unsupported protocol versions.","Verify packet parsing alignment upstream — a desynced read turns ordinary data into invalid IDs.","If extensibility is needed, add a fallback Unknown(i32) handling path instead of erroring."],"exampleFix":"// before\nlet name = ContainerName::from_id(value)?; // Err on 67\n// after\nlet name = ContainerName::from_id(value).unwrap_or(ContainerName::Dynamic); // or reject client","handlingStrategy":"try-catch","validationCode":"fn known_container_id(v: u32) -> bool { v <= 66 }","typeGuard":null,"tryCatchPattern":"match ContainerName::decode(buf) {\n    Ok(name) => name,\n    Err(e) if e.to_string().starts_with(\"Invalid ContainerName ID\") => {\n        log::warn!(\"unknown container id from client — update protocol? \");\n        ContainerName::Dynamic\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep the server updated for new Bedrock container IDs.","Validate client protocol version at handshake.","Check for upstream desync when the invalid ID looks random."],"tags":["protocol","bedrock","enum","deserialization"],"backgroundTag":"invalid-enum-value","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"}