vitessio/vitess · error

can't strip checksum from binlog event: %v, event data: %#v

Error message

can't strip checksum from binlog event: %v, event data: %#v

What it means

After the format description is known, vstreamer strips the trailing checksum bytes from each binlog event using the format recorded in the FORMAT_DESCRIPTION_EVENT. If StripChecksum fails, the event bytes do not match the declared format, so the event cannot be safely decoded and the stream is aborted.

Source

Thrown at go/vt/vttablet/tabletserver/vstreamer/vstreamer.go:554

		return nil, nil
	}

	// We can't parse anything until we get a FORMAT_DESCRIPTION_EVENT that
	// tells us the size of the event header.
	if vs.format.IsZero() {
		// The only thing that should come before the FORMAT_DESCRIPTION_EVENT
		// is a fake ROTATE_EVENT, which the primary sends to tell us the name
		// of the current log file.
		if ev.IsRotate() {
			return nil, nil
		}
		return nil, fmt.Errorf("got a real event before FORMAT_DESCRIPTION_EVENT: %#v", ev)
	}

	// Strip the checksum, if any. We don't actually verify the checksum, so discard it.
	ev, _, err := ev.StripChecksum(vs.format)
	if err != nil {
		return nil, fmt.Errorf("can't strip checksum from binlog event: %v, event data: %#v", err, ev)
	}

	shouldSend := func(evType binlogdatapb.VEventType) bool {
		if vs.eventTypesToStream != nil && !vs.eventTypesToStream[evType] {
			return false
		}
		return true
	}

	timeNowUnixNano := time.Now().UnixNano()
	var vevents []*binlogdatapb.VEvent
	switch {
	case ev.IsRotate(), ev.IsStop():
		vs.eventGTID = nil
	case ev.IsPreviousGTIDs():
		if !shouldSend(binlogdatapb.VEventType_PREVIOUS_GTIDS) {
			return nil, nil
		}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Check that binlog_checksum is consistent across all MySQL servers in the topology
  2. Restart the vstream so a fresh FORMAT_DESCRIPTION_EVENT is captured for the current server
  3. Verify binlog file integrity with mysqlbinlog --verify-binlog-checksum
  4. Inspect for proxies or binlog filtering tools altering event payloads between MySQL and Vitess
Defensive patterns

Strategy: retry

Validate before calling

// Check checksum consistency across servers:
// SELECT @@global.binlog_checksum; -- must match on primary and replicas

Try / catch

if strings.Contains(err.Error(), "can't strip checksum from binlog event") {
    // stop the vstream, verify binlog integrity, restart to re-read FORMAT_DESCRIPTION_EVENT
}

Prevention

When it happens

Trigger: parseEvent calls ev.StripChecksum(vs.format) and it returns an error — typically because the event's declared checksum type/length disagrees with the actual buffer size or the format captured earlier.

Common situations: Mixing events from servers with different checksum settings (binlog_checksum OFF vs CRC32) across a failover; corrupted binlog bytes; a relay/middleman that truncates or rewrites events.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/0620b0ea58741291. Report an issue: GitHub.