{"record":{"id":"7ada454a2c62e84c","repo":"vllm-project/vllm","slug":"messagepack-value-decode-failed","errorCode":null,"errorMessage":"messagepack value decode failed","messagePattern":"messagepack value decode failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"rust/src/engine-core-client/src/error.rs","lineNumber":27,"sourceCode":"\nuse crate::protocol::utility::UtilityCallId;\n\npub type Result<T> = std::result::Result<T, Error>;\n\n/// Public error type for the Rust engine-core client.\n#[derive(Debug, Error, Macro)]\npub enum Error {\n    #[error(\"messagepack encode failed for {target_type}: {message}\")]\n    Encode {\n        target_type: &'static str,\n        message: String,\n    },\n    #[error(\"messagepack decode failed for {target_type}: {message}\")]\n    Decode {\n        target_type: &'static str,\n        message: String,\n    },\n    #[error(\"messagepack value decode failed\")]\n    ValueDecode(#[from] rmpv::decode::Error),\n    #[error(\"messagepack ext value decode failed: {message}\")]\n    ExtValueDecode { message: String },\n    #[error(\"invalid structured outputs params: {message}\")]\n    InvalidStructuredOutputsParams { message: String },\n    #[error(\"io error\")]\n    Io(#[from] std::io::Error),\n    #[error(\"transport error\")]\n    Transport(#[from] zeromq::ZmqError),\n    #[error(\"ZMQ runtime task failed\")]\n    ZmqRuntimeTask(#[from] tokio::task::JoinError),\n    #[error(\"engine core reported fatal failure\")]\n    EngineCoreDead,\n    #[error(\"startup handshake timed out while waiting for {stage} after {timeout:?}\")]\n    HandshakeTimeout {\n        stage: &'static str,\n        timeout: Duration,\n    },","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/rust/src/engine-core-client/src/error.rs#L9-L45","documentation":"Error::ValueDecode wraps rmpv::decode::Error via #[from]. It is produced when a dynamic MessagePack value read from a byte stream fails at the rmpv layer (malformed MessagePack bytes, truncated frame, bad type marker) before any typed conversion happens.","triggerScenarios":"Any code path that reads rmpv::Value directly from engine bytes — e.g. dynamic inspection of output payloads or logprobs decoding — where the byte buffer is not valid MessagePack. The From impl converts the raw rmpv error into this variant automatically at ? boundaries.","commonSituations":"Frames corrupted or truncated in transit, a ZMQ multipart message reassembled with wrong frame boundaries, or a Python-side encoder change emitting a format rmpv rejects. Rare compared to the typed Decode variant; usually indicates genuinely malformed bytes rather than a schema mismatch.","solutions":["Log the frame length and first bytes at the failure site to distinguish truncation from corruption","Verify the Python encoder (msgpack) and Rust decoder (rmpv) versions agree on MessagePack spec level","Check frame reassembly logic if custom aux-frame splitting is in play","If reproducible, feed the exact bytes to rmpv::decode::read_value in a test and file the frame dump"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_value_decode_error(e: &engine_core_client::Error) -> bool {\n    matches!(e, engine_core_client::Error::ValueDecode(_))\n}","tryCatchPattern":"if let Err(engine_core_client::Error::ValueDecode(inner)) = result {\n    tracing::error!(?inner, \"malformed messagepack frame\");\n}","preventionTips":["Treat ValueDecode as corruption: capture the frame bytes for diagnosis rather than retrying","Keep msgpack encode/decode libraries on compatible spec levels across the FFI boundary"],"tags":["rust","deserialization","messagepack","corruption"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}