{"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":"exception","errorClass":"ChunkedGelfDecoderError","httpStatus":null,"severity":"error","filePath":"lib/codecs/src/decoding/framing/chunked_gelf.rs","lineNumber":407,"sourceCode":"            // We need to spawn a task that will clear the message state after a certain time\n            // otherwise we will have a memory leak due to messages that never complete\n            let state = Arc::clone(&self.state);\n            let timeout = self.timeout;\n            let timeout_handle = tokio::spawn(async move {\n                tokio::time::sleep(timeout).await;\n                let mut state_lock = state.lock().expect(\"poisoned lock\");\n                if state_lock.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            Box::new(MessageState::new(total_chunks, timeout_handle))\n        });\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":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/vectordotdev/vector/blob/99894c8d8885659cc16efc39bd71f9fb3b59e296/lib/codecs/src/decoding/framing/chunked_gelf.rs#L389-L425","documentation":"GELF reassembly keys pending chunks by the 8-byte message id and assumes every chunk of a message agrees on the total-chunks count. When a chunk arrives whose total-chunts byte differs from the value recorded when the message state was created, `TotalChunksMismatchSnafu` rejects it, because merging chunks of two different messages would corrupt data. This is effectively a message-id collision or a sender bug detector.","triggerScenarios":"Two distinct GELF messages generated with the same 8-byte message id but different chunk counts interleave on the wire; or a sender that recomputes/changes the total for retransmitted chunks of the same id.","commonSituations":"Custom senders deriving message id from a low-entropy value (timestamp seconds, hash of a template) so distinct large messages collide; duplicated/retx paths that split the same id differently after a payload change; multiple sender processes sharing an id scheme.","solutions":["Make the sender use a unique random 64-bit message id per message (as the GELF spec intends) — e.g. UUID bytes or a strong hash of the payload.","If retransmission re-chunks a message, keep the chunk split identical or use a fresh message id for the retransmission.","Grep sender logs for the reported message_id to identify which two messages collided."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Err(e) if e.to_string().contains(\"different total chunks values\") => {\n    warn!(error = %e, \"GELF message-id collision; dropping chunk\");\n}","preventionTips":["Generate message ids with a strong 64-bit random source (UUID prefix) in custom senders.","Never reuse an id across re-chunked retransmissions.","When this error appears, grep sender logs for the message_id to find the colliding producers."],"tags":["gelf","udp","reassembly","message-id","vector"],"backgroundTag":"gelf-chunk-mismatch","analyzedSha":"99894c8d8885659cc16efc39bd71f9fb3b59e296","analyzedAt":"2026-08-25T10:53:08.793Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}