grpc protocol_error ai_generated true

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

UNIMPLEMENTED: grpc: Unsupported compression algorithm: deflate

ID: grpc/invalid-compression-algorithm

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

版本兼容性

版本状态引入弃用备注
gRPC Python 1.47.0 active
gRPC C++ 1.49.0 active

根因分析

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

English

The client requested a compression algorithm that the server does not support.

generic

官方文档

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

解决方案

  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.

无效尝试

常见但无效的做法:

  1. 90% 失败

    gRPC does not support deflate; it only supports gzip, identity, and optionally snappy or zstd.

  2. 70% 失败

    The server will still reject it because the algorithm is not in its supported list.

  3. 95% 失败

    gRPC does not negotiate compression; mismatch causes immediate failure.