# "Wire format is invalid: Error: illegal buffer"

**URL:** <https://discourse.nodered.org/t/wire-format-is-invalid-error-illegal-buffer/49070>\
**Category:** General\
**Created:** [29 July 2021 08:45 UTC](https://discourse.nodered.org/t/wire-format-is-invalid-error-illegal-buffer/49070 "2021-07-29T08:45:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discourse.nodered.org/u/Nirajan)\
**Post date:** [29 July 2021 08:45 UTC](https://discourse.nodered.org/t/wire-format-is-invalid-error-illegal-buffer/49070/1 "2021-07-29T08:45:09Z")

</div>

Hello Everyone,

I am trying to decode/deserialize a Kafka message using kafka consumer. The serialization process at the producer side is functioning well but while trying to decode the message, i am getting "Wire format is invalid: Error: illegal buffer" error.

I could not see many options in kafka consumer to change further options. I have used the same .proto files at producer and consumer nodes. My .proto file looks like below:

syntax = "proto3";

package jspb.test;

option java\_package = "com.google.apps.jspb.proto";  
option java\_multiple\_files = true;

// legacy data, must be nested

message data {  
required string company = 1;  
required string street = 2;  
required string country = 3;  
required string state = 4;  
required string companyType = 5;  
}

Can anyone please suggest me a solution or help me find out a problem?  
Any help would be really appreciated. Thank you very much.

Best Regards,

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 July 2021 10:23 UTC](https://discourse.nodered.org/t/wire-format-is-invalid-error-illegal-buffer/49070/2 "2021-07-29T10:23:46Z")

</div>

Hi and welcome to the forum. However, this looks like a Kafka problem rather than a Node-RED one? Maybe there is a Kafka support forum?

---

<div class="post-metadata">

**Author:** ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discourse.nodered.org/u/Nirajan)\
**Post date:** [29 July 2021 11:20 UTC](https://discourse.nodered.org/t/wire-format-is-invalid-error-illegal-buffer/49070/3 "2021-07-29T11:20:48Z")

</div>

Hello,  
Thank your for your response. I just solved the issue. I had to convert the message received from kafka consumer to "Buffer Binary" message format using a "function" node before passing the message to protobuf decode node.

Best Regards,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 August 2021 11:21 UTC](https://discourse.nodered.org/t/wire-format-is-invalid-error-illegal-buffer/49070/4 "2021-08-12T11:21:35Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
