com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own len

60 views
Skip to first unread message

Chetan M

unread,
Feb 3, 2020, 9:51:55 AM2/3/20
to Protocol Buffers
I have a proto definition that has too many fields.I ended up just populating a couple of fields for test and sending them out but the consumer complains when parsing with the above message.Why is it so?I wouldn't be sending down messages with just 2-3 fields in production env but for testing I don't want to end up populating the 50 odd fields that are there on the protobuf definition.My instance has no required fields so it passes the validity test during send.Could you please help me here ?

Marc Gravell

unread,
Feb 3, 2020, 10:15:49 AM2/3/20
to Chetan M, Protocol Buffers
The most likely thing is that it was truncated during your transmission, meaning: a bug in your code that serializes and/or sends the data. Can we see any of that code? Note that you can use "protoc" (decode-raw) or https://protogen.marcgravell.com/decode to validate a payload for integrity.

On Mon, 3 Feb 2020, 14:51 Chetan M, <cvm.reta...@gmail.com> wrote:
I have a proto definition that has too many fields.I ended up just populating a couple of fields for test and sending them out but the consumer complains when parsing with the above message.Why is it so?I wouldn't be sending down messages with just 2-3 fields in production env but for testing I don't want to end up populating the 50 odd fields that are there on the protobuf definition.My instance has no required fields so it passes the validity test during send.Could you please help me here ?

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/42b73d13-5628-4c2b-a0d5-e1b2d3df50b2%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages