0

I'm running a simple etcd connection with springbok example. I keep getting an error w.r.t grcp in both my spring boot logs and server logs. How can I fix this?

 @Scheduled(fixedRate = 5000)
    public void test() throws EtcdException, ExecutionException, InterruptedException {
        // create client
        Client client = Client.builder().endpoints("http://localhost:2379").build();
        KV kvClient = client.getKVClient();

        ByteSequence key = ByteSequence.fromBytes("test_key".getBytes());
        ByteSequence val = ByteSequence.fromBytes("test_val".getBytes());
// put the key-value
        kvClient.put(key, val);

// get the CompletableFuture
        CompletableFuture<GetResponse> getFuture = kvClient.get(key);

// get the value from CompletableFuture
        GetResponse response = getFuture.get();
        System.out.println(response.toString());
    }

Error

.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: INTERNAL: Connection closed with unknown cause
    at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:476) ~[guava-19.0.jar:na]
    at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:455) ~[guava-19.0.jar:na]
    at com.coreos.jetcd.internal.impl.Util.lambda$toCompletableFutureWithRetry$1(Util.java:125) ~[jetcd-core-0.0.1.jar:na]
    ... 3 common frames omitted
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Connection closed with unknown cause
    at io.grpc.Status.asRuntimeException(Status.java:526) ~[grpc-core-1.5.0.jar:1.5.0]
    at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:427) ~[grpc-stub-1.5.0.jar:1.5.0]
    at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:41) ~[grpc-core-1.5.0.jar:1.5.0]
    at com.coreos.jetcd.internal.impl.ClientConnectionManager$AuthTokenInterceptor$1$1.onClose(ClientConnectionManager.java:267) ~[jetcd-core-0.0.1.jar:na]
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:419) ~[grpc-core-1.5.0.jar:1.5.0]
    at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:60) ~[grpc-core-1.5.0.jar:1.5.0]
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:493) ~[grpc-core-1.5.0.jar:1.5.0]
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$500(ClientCallImpl.java:422) ~[grpc-core-1.5.0.jar:1.5.0]
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:525) ~[grpc-core-1.5.0.jar:1.5.0]
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.5.0.jar:1.5.0]
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:102) ~[grpc-core-1.5.0.jar:1.5.0]
    ... 3 common frames omitted

At ETCD server

WARNING: 2020/04/16 00:23:15 grpc: Server.processUnaryRPC failed to write status: connection error: desc = "transport is closing"

Tried setting the keep alive property but didn't work

grpc.client.GLOBAL.keep-alive-time=5000
user3310115
  • 1,372
  • 2
  • 18
  • 48

1 Answers1

0

So it turns out that the grcp version was the reason, I was using verion 1.5.0 but when I moved to version 1.9.0, the issue was resolved for me.

user3310115
  • 1,372
  • 2
  • 18
  • 48