# INTERNAL: grpc: compression algorithm negotiation failed

- **ID:** `grpc/compression-negotiation-failed`
- **Domain:** grpc
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

Client and server do not support a common compression algorithm; client sends a message with an unsupported algorithm or server rejects the proposed algorithm during handshake.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC C++ 1.45+ | active | — | — |
| gRPC Go 1.45+ | active | — | — |
| gRPC Python 1.45+ | active | — | — |

## Workarounds

1. **Ensure both client and server use the same compression algorithm. Set client-side: grpc.WithDefaultCallOptions(grpc.UseCompressor("gzip")) in Go. On server, register compressor: import "google.golang.org/grpc/encoding/gzip"** (90% success)
   ```
   Ensure both client and server use the same compression algorithm. Set client-side: grpc.WithDefaultCallOptions(grpc.UseCompressor("gzip")) in Go. On server, register compressor: import "google.golang.org/grpc/encoding/gzip"
   ```
2. **Upgrade gRPC libraries to latest versions to support modern compression algorithms like gzip or snappy. In Python: pip install grpcio==1.60.0 and set grpc.Compression.Gzip** (80% success)
   ```
   Upgrade gRPC libraries to latest versions to support modern compression algorithms like gzip or snappy. In Python: pip install grpcio==1.60.0 and set grpc.Compression.Gzip
   ```

## Dead Ends

- **Enabling all compression algorithms on both sides** — May increase memory usage and latency; also some algorithms (e.g., deflate) are deprecated and may cause interoperability issues. (35% fail)
- **Disabling compression entirely** — Increases bandwidth usage; may not be acceptable for high-volume services. (25% fail)
