{"record":{"id":"4b438b4448ca4f6b","repo":"vectordotdev/vector","slug":"received-chunk-with-message-id-message-id-and-se-4b438b","errorCode":null,"errorMessage":"Received chunk with message id {message_id} and sequence number {sequence_number} has different total chunks values: original total chunks value is {original_total_chunks} and received total chunks value is {received_total_chunks}","messagePattern":"Received chunk with message id (.+?) and sequence number (.+?) has different total chunks values: original total chunks value is (.+?) and received total chunks value is (.+?)","errorType":"error_code","errorClass":"ChunkedGelfDecoderError::TotalChunksMismatch","httpStatus":null,"severity":"error","filePath":"lib/codecs/src/decoding/framing/chunked_gelf.rs","lineNumber":523,"sourceCode":"                    .get(&message_id)\n                    .is_some_and(|message| message.timeout_task.id() == timeout_task_id);\n                if owns_message && pending.remove(message_id).is_some() {\n                    warn!(\n                        message_id = message_id,\n                        timeout_secs = timeout.as_secs_f64(),\n                        \"Message was not fully received within the timeout window. Discarding it.\"\n                    );\n                }\n            });\n            pending.messages.insert(\n                message_id,\n                Box::new(MessageState::new(total_chunks, timeout_handle)),\n            );\n        }\n\n        let message_state = pending.messages.get(&message_id).expect(\"entry must exist\");\n\n        ensure!(\n            message_state.total_chunks == total_chunks,\n            TotalChunksMismatchSnafu {\n                message_id,\n                sequence_number,\n                original_total_chunks: message_state.total_chunks,\n                received_total_chunks: total_chunks\n            }\n        );\n\n        if message_state.is_chunk_present(sequence_number) {\n            debug!(\n                message_id = message_id,\n                sequence_number = sequence_number,\n                \"Received a duplicate chunk. Ignoring it.\"\n            );\n            return Ok(None);\n        }\n","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/lib/codecs/src/decoding/framing/chunked_gelf.rs#L505-L541","documentation":"When decoding a chunked GELF message (RFC chunked GELF over UDP), each chunk carries a message id and a total chunk count. This error is thrown by decode_chunk when a chunk with the same message id declares a total_chunks value different from the one recorded when the message's first chunk was seen. A mismatch means the sender's chunks cannot be reassembled into one message.","triggerScenarios":"Sending multiple GELF chunk sequences that reuse the same 8-byte/64-bit message id but with differing total chunk counts within the reassembly timeout window; a buggy or colliding producer generating non-unique message ids; chunks from unrelated messages colliding after id truncation (e.g. md5/prefix ids).","commonSituations":"High-volume syslog/GELF UDP senders where id generation collides; producers that truncate a longer id (like a 64-bit prefix of md5) causing duplicates; multiple hosts behind NAT reusing sequential ids.","solutions":["Fix the producer to generate a unique message id per message (e.g. full md5 hash of the payload or a proper random 64-bit value).","Drop/flush the stale pending message on the Vector side by reducing the GELF reassembly timeout so conflicting sequences don't coexist.","If ids are truncated prefixes, increase id length so collisions don't occur.","Check for multiple senders sharing the same message id space and namespace them per host."],"exampleFix":"// before (producer)\nlet id = payload_hash[..8].to_vec();\n// after\nlet id = full_md5_hash[..8].to_vec(); // id derived from full message, unique per message","handlingStrategy":"validation","validationCode":"// producer-side check before chunking\nfn assert_unique_id(ids: &[[u8; 8]], seen: &mut HashSet<[u8; 8]>) -> bool {\n    ids.iter().all(|id| seen.insert(*id))\n}","typeGuard":"fn is_chunk_consistent(state_total: u8, chunk_total: u8) -> bool {\n    state_total == chunk_total\n}","tryCatchPattern":null,"preventionTips":["Generate GELF message ids from a hash of the full message payload (md5 style).","Keep the reassembly timeout shorter than the realistic id-reuse interval.","Namespace ids per sender if multiple producers share id space."],"tags":["gelf","udp","codecs","framing"],"backgroundTag":"conflicting-input-values","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}