# 未实现：不支持的压缩算法：deflate

- **ID:** `grpc/invalid-compression-algorithm`
- **领域:** grpc
- **类别:** protocol_error
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

客户端请求了服务器不支持的压缩算法。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| gRPC Python 1.47.0 | active | — | — |
| gRPC C++ 1.49.0 | active | — | — |

## 解决方案

1. ```
   Change the client to use gzip compression. Example: `channel = grpc.insecure_channel('target', options=[('grpc.default_compression_algorithm', grpc.Compression.Gzip)])`
   ```
2. ```
   If using custom compression, register it on both sides via `grpc.Compression` API.
   ```

## 无效尝试

- **** — gRPC does not support deflate; it only supports gzip, identity, and optionally snappy or zstd. (90% 失败率)
- **** — The server will still reject it because the algorithm is not in its supported list. (70% 失败率)
- **** — gRPC does not negotiate compression; mismatch causes immediate failure. (95% 失败率)
