-
Notifications
You must be signed in to change notification settings - Fork 81
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
"Symbol not found" when running gRPCox in Docker/K8s #13
Comments
I think its not related with your app environment (docker & k8s).. its should be related with either your gRPC server reflection or protoc generator.. what your gRPC server language? |
update on the environment story: I ran evans CLI from another pod in k8s and was able to access all the messages, rpcs, etc. and even call the rpcs without any issue. I also now agree that it's not the app environment. My server's language is Python and I used the Python grpc-tools package to generate my proto code, as per the grpc documentation. I somehow doubt that it's the generator, because it works in every other environment that I can try. But I do agree that it could be the configuration of server reflection. I'm using the same code from this documentation here. Maybe something extra needs to be configured so that gRPCox can discover everything. |
could you share your .proto file? at least for that failing methods? |
I'm not really allowed to share the proto file, but I can tell you that all methods are failing. I can provide information about what the shape of the messages is, if that's helpful. |
is there any import from external proto? |
Nope, no imports! |
I have the same problem with a very simple proto file: syntax = "proto3";
package example_package;
message ServerMessage {
oneof server_message {
string a = 1;
string b = 2;
};
}
message ClientMessage {
oneof client_message {
string a = 1;
string b = 2;
};
}
service Example {
rpc unaryCall(ClientMessage) returns (ServerMessage) {}
rpc serverStreamingCall(ClientMessage) returns (stream ServerMessage) {}
rpc clientStreamingCall(stream ClientMessage) returns (ServerMessage) {}
rpc bidirectionalStreamingCall(stream ClientMessage) returns (stream ServerMessage) {}
} With the proto file located in proto-loader-gen-types --longs=String --enums=String --defaults --oneofs --grpcLib=@grpc/grpc-js --outDir=proto/ proto/*.proto Here's the server code in typescript: import * as grpc from '@grpc/grpc-js';
import * as protoLoader from '@grpc/proto-loader';
import * as reflection from '@grpc/reflection';
import { ProtoGrpcType } from './proto/example';
import { ClientMessage } from './proto/example_package/ClientMessage';
import { ExampleHandlers } from './proto/example_package/Example';
import { ServerMessage } from './proto/example_package/ServerMessage';
const host = '0.0.0.0:9090';
const exampleServer: ExampleHandlers = {
unaryCall(
call: grpc.ServerUnaryCall<ClientMessage, ServerMessage>,
callback: grpc.sendUnaryData<ServerMessage>
) {
if (call.request) {
console.log(`(server) Got client message: ${call.request.clientMessage}`);
}
callback(null, {
b: 'Message from server',
});
},
serverStreamingCall(
call: grpc.ServerWritableStream<ClientMessage, ServerMessage>
) {
call.write({
b: 'Message from server',
});
call.end();
},
clientStreamingCall(
call: grpc.ServerReadableStream<ClientMessage, ServerMessage>
) {
call.on('data', (clientMessage: ClientMessage) => {
console.log(
`(server) Got client message: ${clientMessage.clientMessage}`
);
});
},
bidirectionalStreamingCall(
call: grpc.ServerDuplexStream<ClientMessage, ServerMessage>
) {
call.write({
b: 'Message from server',
});
call.on('data', (clientMessage: ClientMessage) => {
console.log(
`(server) Got client message: ${clientMessage.clientMessage}`
);
});
},
};
function getServer(): grpc.Server {
const packageDefinition = protoLoader.loadSync('./proto/example.proto', {
longs: String,
enums: String,
defaults: true,
oneofs: true,
});
const proto = grpc.loadPackageDefinition(
packageDefinition
) as unknown as ProtoGrpcType;
const server = new grpc.Server();
const reflect = new reflection.ReflectionService(packageDefinition);
reflect.addToServer(server);
server.addService(proto.example_package.Example.service, exampleServer);
return server;
}
if (require.main === module) {
const server = getServer();
server.bindAsync(
host,
grpc.ServerCredentials.createInsecure(),
(err: Error | null, port: number) => {
if (err) {
console.error(`Server error: ${err.message}`);
} else {
console.log(`Server bound on port: ${port}`);
server.start();
}
}
);
} I'm running docker run --net=host gusaul/grpcox UI output: |
Hi,
First off, wanted to say nice job on the gRPCox tool. It's super handy for gRPC development.
I would like to run gRPCox on Kubernetes, in order to test the connection between the client and the server. When I run the gRPC reflection-enabled server on my local machine, I have no problems communicating with it using gRPCox. However, when I run the server in either a Docker container or Kubernetes, I get a strange error.
Using gRPCox I can choose the service. But when I choose one of the methods, I get an error: "Symbol not found: " (see screenshot below).
I suspect it may have to do with the way my server's environment is configured in its Docker container, but I don't know where to start. Could you please advise on this issue?
Thanks!
The text was updated successfully, but these errors were encountered: