# UNIMPLEMENTED: grpc: 未安装算法 gzip 的解压器

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

## 根因

gRPC 客户端或服务器收到使用未注册解压器的算法压缩的消息，通常由于缺少压缩库的构建。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| gRPC C++ 1.62.0 | active | — | — |
| gRPC Python 1.64.0 | active | — | — |
| gRPC Go 1.65.0 | active | — | — |

## 解决方案

1. ```
   重新构建 gRPC 并启用压缩支持：在 C++ 中，设置 `-DgRPC_BUILD_CODEC=ON` 和 `export GRPC_DEFAULT_SSL_ROOTS_FILE_PATH=/etc/ssl/certs/ca-certificates.crt` 然后重新编译
   ```
2. ```
   在 gRPC Python 中，安装带额外压缩的版本：`pip install grpcio[compression]` 或显式导入 `grpc._compression` 并注册 `grpc.Compression.Gzip`
   ```

## 无效尝试

- **Reinstall gRPC without any compression flags** — Default install may not include gzip support; need explicit build flag. (70% 失败率)
- **Disable compression on the server only** — Client may still send compressed messages if not configured to avoid it. (60% 失败率)
- **Set environment variable to force plain text mode** — gRPC compression is negotiated per call; env vars don't override protocol. (80% 失败率)
