# rpc error: code = DataLoss desc = message checksum mismatch: expected 0x1234, got 0x5678

- **ID:** `go/grpc-data-loss-message-corrupted`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The protobuf message was corrupted during transmission, causing a checksum validation failure.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0 | active | — | — |
| 1.1 | active | — | — |

## Workarounds

1. **Implement retry with a new context to avoid reusing corrupted data.** (80% success)
   ```
   for i := 0; i < 3; i++ {
    ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
    resp, err := client.SomeRPC(ctx, req)
    cancel()
    if err == nil { return resp }
    if status.Code(err) != codes.DataLoss { return err }
    time.Sleep(100 * time.Millisecond)
}
   ```
2. **Use a reliable transport like TLS to reduce corruption.** (95% success)
   ```
   conn, err := grpc.Dial("localhost:8080", grpc.WithTransportCredentials(creds))
   ```

## Dead Ends

- **Ignore the checksum and resend the same message.** — The same corruption may occur again if the underlying network issue persists. (70% fail)
- **Disable checksum validation on the server.** — This compromises data integrity and is not recommended. (90% fail)
