# rpc error: code = ResourceExhausted desc = grpc: received message larger than max (5242880 vs. 4194304)

- **ID:** `go/grpc-message-too-large`
- **Domain:** go
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Client or server default max message size (4MB) is exceeded by the payload.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.2 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   opts := []grpc.DialOption{grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(10*1024*1024))}; conn, _ := grpc.Dial("addr", opts...)
   ```
2. **** (80% success)
   ```
   Implement a bidirectional stream to send data in chunks.
   ```

## Dead Ends

- **** — Memory is not the bottleneck; the gRPC framework has hard-coded limits. (95% fail)
- **** — Compression not enabled on both sides, and gRPC may not auto-decompress. (60% fail)
