# INTERNAL: grpc: status details truncated: received 4096 bytes but expected 8192

- **ID:** `grpc/status-details-truncated`
- **Domain:** grpc
- **Category:** protocol_error
- **Error Code:** `ESTATUSTRUNC`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The gRPC status details in the response trailer are larger than the configured max receive message size, causing truncation and an internal error.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC v1.58.0 | active | — | — |
| gRPC v1.61.0 | active | — | — |
| gRPC v1.65.0 | active | — | — |

## Workarounds

1. **Increase the client's max receive message size to accommodate larger status details: `channel = grpc.insecure_channel(target, options=[('grpc.max_receive_message_length', 16 * 1024 * 1024)])`** (95% success)
   ```
   Increase the client's max receive message size to accommodate larger status details: `channel = grpc.insecure_channel(target, options=[('grpc.max_receive_message_length', 16 * 1024 * 1024)])`
   ```
2. **On the server side, reduce the size of status details by using concise error messages or splitting details across multiple RPCs.** (80% success)
   ```
   On the server side, reduce the size of status details by using concise error messages or splitting details across multiple RPCs.
   ```
3. **If using gRPC-Web, configure the proxy to increase the max trailer size (e.g., Envoy's `max_request_headers_kb`).** (85% success)
   ```
   If using gRPC-Web, configure the proxy to increase the max trailer size (e.g., Envoy's `max_request_headers_kb`).
   ```

## Dead Ends

- **Increasing the client's max send message size to match the expected size.** — The error is about receiving, not sending; max send size controls outgoing payloads, not incoming trailers. (90% fail)
- **Setting the environment variable GRPC_VERBOSITY=DEBUG to get more details.** — Verbose logging does not resolve protocol-level truncation; it only adds noise. (95% fail)
- **Reducing the number of fields in the status details on the server side without checking max receive size.** — If the max receive size is too small, even a single large detail can cause truncation; the fix must target the limit. (50% fail)
