V0.35.0 grpc server reflection error

Hi, I think there is a bug with the new grpc server reflection support, but posting here to check. I have a simple unary grpc request I’m trying to get working with server reflection. I’ve copied the example from the release notes, but am getting this error during the grpc client connect.

ERRO[0000] can’t convert method info: proto: file appears multiple times: “tenant/tenant_service.proto”
running at go.k6.io/k6/js/common.Bind.func1 (native)
default at file:///Users/…/git/k6/tenant/get-application-service.js:14:66(10) executor=shared-iterations scenario=default source=stacktrace

line 14 of get-application-service looks like:

client.connect(“localhost:50051”, {plaintext: true, reflect: true});

When I use server reflection with grpc_cli I get the proto def ok:

grpc_cli ls localhost:50051 tenant.grpc.ApplicationService -l
filename: tenant/tenant_service.proto
package: tenant.grpc;
service ApplicationService {
rpc get(tenant.grpc.ApplicationRequest) returns (tenant.grpc.ApplicationResponse) {}
}

Please let me know if more info is required.

Hi @itide, could you share your script to help me locally reproduce this issue (of course, with any sensitive data stripped out)?

The code from the GRPC server that is listening will make my job easier, if possible.

Hi @inanc. Here is the script. If you need the proto files will need to send that directly.

var grpc = require(“k6/net/grpc”);

var client = new grpc.Client();

module.exports.options = {
iterations: 1
};

module.exports.default = function() {
client.connect(“localhost:50051”, {plaintext: true, reflect: true});
var payload = { };
var res = client.invoke(“tenant.grpc.ApplicationService/get”, payload);
if (!k6.check(res, {“ApplicationService get status is OK”: function(r) {return r && r.status === grpc.StatusOK}})){
k6.fail(“ApplicationService get failed”);
};
client.close();
};

Hi @itide,
I tested your shared code with our test grpc service, it works fine.

import k6 from "k6"
var grpc = require("k6/net/grpc");

var client = new grpc.Client();

module.exports.options = {
	iterations: 1
};

module.exports.default = function() {
	client.connect("grpcbin.test.k6.io:9001", {reflect: true});
	var payload = { };
	var res = client.invoke("hello.HelloService/SayHello", payload);
	if (!k6.check(res, {"ApplicationService get status is OK": function(r) {return r && r.status === grpc.StatusOK}})){
		k6.fail("ApplicationService get failed");
	};
	client.close();
};

Please, share your proto files in private so I can investigate more on it, you should also check that you are not defining multiple times any descriptor as the error message is spotting.