EENC
grpc
encoding_error
ai_generated
true
INTERNAL: grpc: invalid message encoding "custom-enc"
ID: grpc/grpc-invalid-message-encoding
85%Fix Rate
87%Confidence
1Evidence
2024-09-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| gRPC v1.63.0 | active | — | — | — |
| gRPC v1.60.0 | active | — | — | — |
| gRPC v1.57.0 | active | — | — | — |
| Go gRPC v1.62.0 | active | — | — | — |
Root Cause
Client or server sends a message with a custom Content-Encoding or Message-Encoding that the peer does not support.
generic中文
客户端或服务器发送了带有对端不支持的 Content-Encoding 或 Message-Encoding 的消息。
Official Documentation
https://grpc.io/docs/guides/compression/#custom-compressionWorkarounds
-
90% success Register a custom codec on both client and server using the same name, e.g., via `grpc.RegisterCompressor` or `WithDefaultCallOptions(grpc.UseCompressor('custom-enc'))`.
Register a custom codec on both client and server using the same name, e.g., via `grpc.RegisterCompressor` or `WithDefaultCallOptions(grpc.UseCompressor('custom-enc'))`. -
80% success Fall back to standard gRPC compression (gzip) by removing the custom encoding from the client's call options.
Fall back to standard gRPC compression (gzip) by removing the custom encoding from the client's call options.
中文步骤
在客户端和服务器上使用相同名称注册自定义编解码器,例如通过 `grpc.RegisterCompressor` 或 `WithDefaultCallOptions(grpc.UseCompressor('custom-enc'))`。通过从客户端调用选项中移除自定义编码,回退到标准 gRPC 压缩(gzip)。
Dead Ends
Common approaches that don't work:
-
Adding the encoding to server's supported list without implementing the codec
80% fail
The server will accept the encoding but fail to decompress, causing DATA_LOSS.
-
Disabling all compression on the client
60% fail
The error is about unrecognized encoding, not compression being enabled.