gRPC Connection with Golang

Hello,

I’ve generated a gRPC client for Golang using the proto definitions and I’m having trouble on ESDB. I’m running the latest docker image and enabled the Protobuf TCP port 1113 and disabled the external TCP TLS for testing to interact with the server through my Go code. Unfortunately, I’m having some TCP Framing issue when trying to use the generated clients (streams, persistent… all of them), it looks like the generated client is not formatting the calls properly for the server.

1,19,15:54:04.780,ERR] FRAMING ERROR! Data:
 "000000: 50 52 49 20 2A 20 48 54 54 50 2F 32 2E 30 0D 0A  | PRI * HTTP/2.0..\n000016: 0D 0A 53 4D 0D 0A 0D 0A 00 00 00 04 00 00 00 00  | ..SM............\n000032: 00                                               | .\n"
[    1,19,15:54:04.788,ERR] Closing connection '"external-normal"""' ["172.17.0.1:36110", L"172.17.0.3:1113", {66cbf6d9-0cf9-4c65-b670-6ca7ecee7620}] due to error. Reason: "Invalid TCP frame received. Error: Package size is out of bounds: 541676112 (max: 67108864).."

Is it even possible at this stage to try and generate a client in Go with gRPC?

Thanks!

EDIT: So things have changed, I managed to have some pieces working

After going through a few bits of information on Google it looks like using the TCP port is not the way to go anymore, and gRPC needs to be used via the HTTP port using a secured TLS connection using the same pem certificate as the server.

I managed to set the Basic auth in my rpc calls to be authenticated and now I’m getting the following error:

Uknown error: Exception was thrown in handler

Unfortunately, nothing show up in the logs of ESDB that would help me debug this and understand what the problem is.

EDIT 2: It’s all figured out, almost

So for the people that might stumble upon that thread, it works properly but the error message is simply not clear. Turns out the payload I was sending was missing some values and now it works.

1 Like

The feedback on missing payload values isn’t great at the moment. We are working to improve that

Also the intention is to release a Golang gRPC client at some point in the future

Indeed, looks like it’s just missing an exception handler that would translate the error to a proper RPC message.

It’s fine for now, I manage to move forward by reading the source code and try to understand why I’m getting the error. (Thank god it’s open source :smile:)

Any idea on when an up-to-date documentation will be out btw?

@julien.ganichot We are going to be releasing some parts soon. It won’t be exhaustive but we will be continuing to work on it

Awesome, thanks for the heads up! If I can be of any help regarding the Go implementation of the client, I’d be happy to.

Hello. I’m also waiting for the gRPC Client from golang. I would like to know when it will be released.

1 Like