grpc encoding_error ai_generated true

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

UNIMPLEMENTED: grpc: Decompressor is not installed for algorithm gzip

ID: grpc/compression-algorithm-not-installed

其他格式: JSON · Markdown 中文 · English
85%修复率
83%置信度
1证据数
2024-05-12首次发现

版本兼容性

版本状态引入弃用备注
gRPC C++ 1.62.0 active
gRPC Python 1.64.0 active
gRPC Go 1.65.0 active

根因分析

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

English

The gRPC client or server received a message compressed with an algorithm for which no decompressor is registered, often due to missing build of compression library.

generic

官方文档

https://grpc.io/docs/guides/compression/

解决方案

  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`

无效尝试

常见但无效的做法:

  1. Reinstall gRPC without any compression flags 70% 失败

    Default install may not include gzip support; need explicit build flag.

  2. Disable compression on the server only 60% 失败

    Client may still send compressed messages if not configured to avoid it.

  3. Set environment variable to force plain text mode 80% 失败

    gRPC compression is negotiated per call; env vars don't override protocol.