-
Notifications
You must be signed in to change notification settings - Fork 45
Description
I am encountering a protocol violation where the server appends an unexpected tag to the end of a gRPC response. Specifically, after the expected fields of the response message are serialized, the stream contains an additional Field Number 12 with Wire Type 4 (EndGroup).
This causes standard Protobuf parsers and network inspectors to fail with an "Unknown or unsupported wiretype" error.
Wire Type 4 seems to be deprecated in proto3. Its presence here as a standalone "footer" violates the Proto3 wire specification and breaks compatibility with non-Kotlin gRPC clients. I suspect this started with the addition of the custom codecs, because in the latest releases (0.10.0-grpc-127 or 0.10.1-grpc-155), the same model was working fine.
Reproduction Structure
Sample .proto Definition
syntax = "proto3";
package com.example.generic;
message ChildItem {
int64 timestamp = 1;
double value = 2;
}
message EmptyRequest {}
message RootResponse {
repeated ChildItem items = 1;
string metadata = 2;
}
service ExampleService {
rpc GetData (EmptyRequest) returns (RootResponse);
}Evidence (Network Analysis)
Below is a breakdown of the response stream. The parser correctly iterates through the generated message fields, but fails immediately after the last valid field of the root message.
Binary Breakdown of the Malformed Footer: [Hex: 64] -> [Binary: 01100 100] -> [Field Number: 12, Wire Type: 4 (End Group)]
Inspector Log (Wireshark)
Protocol Buffers: /com.example.generic.ExampleService/GetData, response
Message: com.example.generic.RootResponse
Field(1): items (message)
Value Length: 280
items: (280 bytes)
Message: com.example.generic.ChildItem
Field(1): timestamp = 1738368000000 (int64)
Field(2): value = 309883250.0 (double)
Field(2): metadata = "sample_meta" (string)
Field(12): <UNKNOWN>
.110 0... = Field Number: 12
.... .100 = Wire Type: End group (deprecated) (4)
[Expert Info (Warning/Protocol): Unknown or unsupported wiretype]
Debugging and Maintenance Barriers
Investigating this issue is currently difficult due to the project's infrastructure and release workflow:
- Lack of Snapshot/Nightly Releases: There are no automated builds for grpc-common changes. I am forced to build the project locally and publish to
mavenLocalto debug. This makes it nearly impossible to provide a shareable, isolated reproduction project, as the required dependencies are not available in any public repository. - Build System Portability: The build process for
kotlinx-rpcappears highly optimized for internal JetBrains environments. Several release tools trigger warnings regarding missing internal developer tokens, making it cumbersome for community members to contribute or verify fixes.
Proposal: Automated Releases
To improve the feedback loop for wire-protocol issues, I beg that an automated Nightly or Snapshot release mechanism for gRPC-related modules be implemented.
Moving away from manual pushes to specific grpc-release branches and providing public snapshots would:
- Enable users to verify fixes in real-world applications without complex local build setups.
- Reduce maintainer effort to release intermediate release candidate versions
- Allow for shareable reproductions that point to public experimental artifacts.