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

Server Reflection does not handle reserved keyword #2709

Open
anushkadoyan opened this issue Apr 3, 2024 · 0 comments
Open

Server Reflection does not handle reserved keyword #2709

anushkadoyan opened this issue Apr 3, 2024 · 0 comments

Comments

@anushkadoyan
Copy link

Problem description

Using ReflectionService from @grpc/reflection, and a .proto with a message "reserved 2", I get this error on grpcurl and also from python's grpcio-reflection:

Failed to list methods for service "testservice.TestService": proto: message "testservice.Test" reserved ranges has invalid range: 2 to 1

No issue with grpcurl 1.8.7, but present on 1.8.9. No issues with grpc client using grpc-js-reflection-client

Reproduction steps

server.js:

  const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
    keepCase: true,
    longs: String,
    enums: String,
    defaults: false,
    oneofs: false,
  });

  const testService = grpc.loadPackageDefinition(packageDefinition);

  // Define the server
  const server = new grpc.Server();
  const reflection = new ReflectionService(packageDefinition);

  reflection.addToServer(server);

test.proto:

syntax = "proto3";

package testservice;

message Test {
    string something = 1;
    reserved 2;
}

message GetTest {
    Test the_test = 1;
}

message Empty {}

service TestService {
    rpc GetTest(Empty) returns (Test) {}
}
grpcurl -plaintext localhost:8080 list testservice.TestService
Failed to list methods for service "testservice.TestService": proto: message "testservice.Test" reserved ranges has invalid range: 2 to 1`

Environment

  • MacOS Monterey 12.1, Apple M1 Pro
  • Node version 20.11.0
  • Node installation method nvm
  • Package name and version @grpc/[email protected]
@anushkadoyan anushkadoyan changed the title Serfer Reflection does not handle reserved keyword Server Reflection does not handle reserved keyword Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants