Not able to connect to GRPC server without TLS


I am referring the sample script to connect to, the GRPC server without TLS. However, the connection was failed due to context deadline exceeded. Could you please help to take a look?

Here is the script I am using:

timport grpc from 'k6/net/grpc';
import { check, sleep } from 'k6';

const client = new grpc.Client();

export default () => {
  client.connect('', {
    plaintext: true,

  const data = { greeting: 'Bert' };
  const response = client.invoke('hello.HelloService/SayHello', data);

  check(response, {
    'status is OK': (r) => r && r.status === grpc.StatusOK,



Note: connecting to GRPC server with TLS works fine.

Hi @jasonchu,
Welcome to the community forum :wave:

It seems like there was a configuration issue with, but at this moment, it’s fixed, and the scenario should work.

Please let me know if it’s still not the case,

@olegbespalov thanks for fixing the server!

Could you share what config change you made on server side? I actually setup my Java based GRPC server on my local (without TLS), and I can use grpcurl to send request to my server. However, when I use the k6 grpc client, I got the same context deadline exceeded error while client.connect.

In our case, the non-TLS port was not exposed. Basically, in that case, the error “context deadline exceeded” means that the GRPC service is unreachable.

Could you please provide more details about the setup? For example, Is it running inside Docker or on a host machine? Are the client’s options the same as in the script above? Does removing the timeout option from the client also not help?

@olegbespalov thanks for looking into this.

The GRPC server is running on my local without docker, it’s just gradlew bootRun.
The k6 script is also running on my local.
The k6 script is all the same as I posted, except that I connect it to my local:port.
I’m also able to run grpcurl to access my GRPC server like below:

grpcurl -plaintext -d @ localhost:6565 <service>/<rpc> <<EOM
// request payload

Removing the timeout option does not help…

Corresponding connect command that I used but got context deadline exceeded

  client.connect('localhost:6565', {
    plaintext: true,

That’s interesting :thinking:

I’m not so familiar with Java, but I tried to make an example of the HelloService, and it works like a charm on my local machine.

Could you please check if this example (repository bellow) works for you?

Thank you so much for trying that out!
I was thinking it may be caused by the GRPC version, but looks like you have been using the latest version in your example repo (same as mine).

I’ll try that out on my local and update in this thread!