{"record":{"id":"fa95369a0d62dcf9","repo":"vectordotdev/vector","slug":"received-chunk-with-message-id-message-id-and-se-fa9536","errorCode":null,"errorMessage":"Received chunk with message id {message_id} and sequence number {sequence_number} has a sequence number greater than its total chunks value of {total_chunks}","messagePattern":"Received chunk with message id (.+?) and sequence number (.+?) has a sequence number greater than its total chunks value of (.+?)","errorType":"validation","errorClass":"ChunkedGelfDecoderError","httpStatus":null,"severity":"error","filePath":"lib/codecs/src/decoding/framing/chunked_gelf.rs","lineNumber":361,"sourceCode":"        ensure!(\n            chunk.remaining() >= 10,\n            InvalidChunkHeaderSnafu { header: chunk }\n        );\n\n        let message_id = chunk.get_u64();\n        let sequence_number = chunk.get_u8();\n        let total_chunks = chunk.get_u8();\n\n        ensure!(\n            total_chunks > 0 && total_chunks <= GELF_MAX_TOTAL_CHUNKS,\n            InvalidTotalChunksSnafu {\n                message_id,\n                sequence_number,\n                total_chunks\n            }\n        );\n\n        ensure!(\n            sequence_number < total_chunks,\n            InvalidSequenceNumberSnafu {\n                message_id,\n                sequence_number,\n                total_chunks\n            }\n        );\n\n        let mut state_lock = self.state.lock().expect(\"poisoned lock\");\n\n        // Only a new message grows the table, so the limit applies on insert. Checking it\n        // before the lookup rejected chunks of messages already pending, which could then\n        // never complete and expired instead.\n        if !state_lock.contains_key(&message_id)\n            && let Some(pending_messages_limit) = self.pending_messages_limit\n        {\n            ensure!(\n                state_lock.len() < pending_messages_limit,","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/vectordotdev/vector/blob/99894c8d8885659cc16efc39bd71f9fb3b59e296/lib/codecs/src/decoding/framing/chunked_gelf.rs#L343-L379","documentation":"Each GELF chunk carries a sequence number that indexes it within its message, so it must be strictly less than the message's total-chunks value. When `sequence_number >= total_chunks`, the decoder rejects the chunk with `InvalidSequenceNumberSnafu` because there is no valid slot to store it in. Like the other chunk-header checks, this is a per-datagram error propagated through the framing `Result`, not a panic.","triggerScenarios":"A chunked datagram where the seq byte is ≥ the total byte — e.g. seq 3 of total 3, total encoded as 0 by an off-by-one sender, or non-GELF binary matching the magic prefix.","commonSituations":"Hand-written GELF chunkers with off-by-one errors (using 1-based sequence numbers instead of 0-based, or writing `count` instead of `count-1`); protocol scanners; corrupted UDP payloads.","solutions":["Fix the sender to use 0-based sequence numbers strictly less than the chunk count (`seq` in `0..total`).","Hex-dump a failing datagram (bytes 9 and 10 after the magic) to see which field is wrong before changing code.","Move non-GELF producers off the GELF UDP port."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Err(e) if e.to_string().contains(\"sequence number greater than\") => {\n    debug!(error = %e, \"discarding chunk with out-of-range sequence\");\n}","preventionTips":["Use 0-based sequence numbers in custom GELF chunkers; add a property test asserting seq < total.","Fuzz custom senders with the same decoder the receiver uses before shipping."],"tags":["gelf","udp","framing","sequence","vector"],"backgroundTag":"gelf-sequence-number-invalid","analyzedSha":"99894c8d8885659cc16efc39bd71f9fb3b59e296","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}