# 未实现：gRPC：未安装 gzip 解压缩器

- **ID:** `grpc/compressor-not-installed`
- **领域:** grpc
- **类别:** encoding_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

gRPC 客户端或服务器未注册处理 gzip 编码消息所需的压缩库。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| grpc-go v1.56.0 | active | — | — |
| grpc-java v1.58.0 | active | — | — |
| grpc-python v1.60.0 | active | — | — |

## 解决方案

1. ```
   在 gRPC 选项中注册 gzip 解压缩器：对于 Python，使用 `grpc.insecure_channel('target', options=[('grpc.enable_decompression', True)])` 并确保已安装支持压缩的 `grpc`。
   ```
2. ```
   在客户端禁用压缩：在通道选项中设置 `grpc.default_compression_algorithm` 为 'identity'：`options=[('grpc.default_compression_algorithm', 0)]`。
   ```

## 无效尝试

- **Reinstall grpc package with pip install --upgrade grpcio** — The issue is not package version but missing compression registration; reinstalling doesn't register the decompressor. (90% 失败率)
- **Set environment variable GRPC_DEFAULT_SSL_ROOTS_FILE_PATH** — This env var controls SSL roots, not compression codecs; completely unrelated. (95% 失败率)
