grpc encoding_error ai_generated true

未实现:gRPC:未安装 gzip 解压缩器

UNIMPLEMENTED: grpc: Decompressor is not installed for gzip

ID: grpc/compressor-not-installed

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

版本兼容性

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

根因分析

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

English

The gRPC client or server does not have the required compression library registered to handle gzip-encoded messages.

generic

官方文档

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

解决方案

  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)]`。

无效尝试

常见但无效的做法:

  1. Reinstall grpc package with pip install --upgrade grpcio 90% 失败

    The issue is not package version but missing compression registration; reinstalling doesn't register the decompressor.

  2. Set environment variable GRPC_DEFAULT_SSL_ROOTS_FILE_PATH 95% 失败

    This env var controls SSL roots, not compression codecs; completely unrelated.