Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC Request returns Error: Message violates its Protobuf type definition #12938

Open
1 task done
Anand911-verteil opened this issue Jun 13, 2024 · 5 comments
Open
1 task done
Labels
bug product/api-client protocol/grpc Issues related to the gRPC protocol experience in Postman

Comments

@Anand911-verteil
Copy link

Anand911-verteil commented Jun 13, 2024

Is there an existing issue for this?

  • I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

The following error occurs when attempting to make gRPC call in Postman after upgrading to v11 (previously on v10).

Error Message:
Error: Message violates its Protobuf type definition

Calls to the respective services is not made it throws this error with no other information, verified the types of protobuf used postman was interpreting one of the Map fields to as repeated and when casting this to as array it worked which is not the actual behaviour of the field in our schema. The error is being logged at the request renderer-requester.log

The issue persists with Postman agent as well.

Steps To Reproduce

  1. Open a gRPC Request in postman
  2. Load the required API Service
  3. Make sure that the schema has some map fields associated with protobuf schema
  4. Invoke the gRPC Request

Screenshots or Videos

image

Operating System

Linux

Postman Version

11.2.1

Postman Platform

Both

User Account Type

Signed In User

Additional Context?

No response

@appurva21 appurva21 added protocol/grpc Issues related to the gRPC protocol experience in Postman product/api-client labels Jun 13, 2024
@appurva21
Copy link
Member

Hey @Anand911-verteil! Thanks for the detailed steps. Unfortunately, I can't see this on our end using the proto below. Could you share a scaled-down version of your proto to help us further investigate this?

syntax = "proto2";

package hello;

service HelloService {
  rpc SayHello(HelloRequest) returns (HelloResponse);
}

message HelloRequest {
  required string greeting = 1;
  map<string, int32> data = 2;
}

message HelloResponse {
  required string reply = 1;
}

@Anand911-verteil
Copy link
Author

Hi @appurva21,

Thank you for reaching out. Unfortunately, I am unable to share the proto schema as it is confidential to our company. However, I can provide some more details or assist in any other way that might help you troubleshoot the issue. Please let me know how else I can assist you.

@jonsor
Copy link

jonsor commented Jun 13, 2024

Hi @appurva21
We are experiencing the samme issue.
Tested for versions

  • v11.1.25
  • v11.2.1

Example proto:

rpc DoFoo(FooRequest) returns (FooResponse);

message FooResponse {
    string response = 1;
}

message FooRequest {

    string this_works = 1;
    map<string, string> this_causes_the_error = 5;
}

Example request body in postman:

{
    "this_causes_the_error": {
        "test1": "test1",
        "test2": "test2"
    },
    "this_works": "test"
}

Error message:
Error: Message violates its Protobuf type definition

@appurva21
Copy link
Member

appurva21 commented Jun 13, 2024

@jonsor Thanks for the details, I can reproduce this now. We'll update this thread once the fix is out.

@appurva21 appurva21 added the bug label Jun 13, 2024
@Anand911-verteil
Copy link
Author

@jonsor Thank you for providing the sample protos.
In my case, the request format includes a nested message within a map:

rpc DoFoo(FooRequest) returns (FooResponse);

message FooResponse {
    string response = 1;
}

message FooRequest {
    string this_works = 1;
    map<string, otherMessage> this_causes_the_error = 5;
}

message otherMessage {
   string someText = 1;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug product/api-client protocol/grpc Issues related to the gRPC protocol experience in Postman
Projects
None yet
Development

No branches or pull requests

3 participants