# RESOURCE_EXHAUSTED: grpc: received message larger than max (8388608 vs. 4194304)

- **ID:** `grpc/client-side-streaming-too-large`
- **Domain:** grpc
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The client sent a message that exceeds the server's configured maximum message size.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC Python 1.48.0 | active | — | — |
| gRPC C++ 1.50.0 | active | — | — |

## Workarounds

1. **Set the max message size on both client and server. On the server, use `grpc.max_receive_message_length` option. Example: `server = grpc.server(futures.ThreadPoolExecutor(), options=[('grpc.max_receive_message_length', 16 * 1024 * 1024)])`** (85% success)
   ```
   Set the max message size on both client and server. On the server, use `grpc.max_receive_message_length` option. Example: `server = grpc.server(futures.ThreadPoolExecutor(), options=[('grpc.max_receive_message_length', 16 * 1024 * 1024)])`
   ```
2. **Compress the payload using gRPC's built-in compression. Enable with `grpc.Compression.Gzip` on channel or call.** (75% success)
   ```
   Compress the payload using gRPC's built-in compression. Enable with `grpc.Compression.Gzip` on channel or call.
   ```

## Dead Ends

- **** — The server still enforces its own limit, so the error persists. (70% fail)
- **** — Negative values are ignored by gRPC; the default limit applies. (40% fail)
- **** — The same size violation will occur again without configuration change. (90% fail)
