title: First Received Frame was not SETTINGS - Etcd Java
body: <p>I am trying to run the jetcd client to access etcd running in a docker container on port 2379</p>
  
  <p>I was using the docker image <code>elcolio/etcd:latest</code> and executed the following command to start the container:</p>
  
  <pre><code>docker run \
    -d \
    -p 2379:2379 \
    -p 2380:2380 \
    -p 4001:4001 \
    -p 7001:7001 \
    -v /data/backup/dir:/data \
    --name some-etcd \
    elcolio/etcd:latest \
    -name some-etcd \
    -discovery=https://discovery.etcd.io/blahblahblahblah \
    -advertise-client-urls http://10.x.x.x:4001 \
    -initial-advertise-peer-urls http://10.x.x.x:7001
  </code></pre>
  
  <p>and I am running only one instance. The container is started successfully and I was able to run the <code>etcdctl</code> on the container. But through Java, I am not able to run it.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>    import com.coreos.jetcd.Client;
  import com.coreos.jetcd.KV;
  import com.coreos.jetcd.data.ByteSequence;
  import com.coreos.jetcd.kv.GetResponse;
  import com.coreos.jetcd.data.ByteSequence;
  
  import java.util.concurrent.CompletableFuture;
  import java.util.concurrent.ExecutionException;
  
  public class Demo {
  
      public static void main(String[] args) throws ExecutionException, InterruptedException {
  
          Client client = Client.builder().endpoints("https://10.x.x.x:2379").build();
          KV kvClient = client.getKVClient();
  
  
          ByteSequence key = ByteSequence.fromString("/message");
          ByteSequence value = ByteSequence.fromString("test_value");
  
  // put the key-value
  //        kvClient.put(key,value).get();
  
  // get the CompletableFuture
          CompletableFuture&lt;GetResponse&gt; getFuture = kvClient.get(key);
  
  // get the value from CompletableFuture
          GetResponse response = getFuture.get();
  
          System.out.println(response);
  
  // delete the key
          kvClient.delete(key).get();
  
  
  
      }
  }
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>Exception in thread "main" java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: INTERNAL: http2 exception
      at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
      at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
      at Demo.main(Demo.java:49)
  Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: INTERNAL: http2 exception
      at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:531)
      at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:512)
      at com.coreos.jetcd.internal.impl.Util.lambda$toCompletableFutureWithRetry$1(Util.java:125)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: io.grpc.StatusRuntimeException: INTERNAL: http2 exception
      at io.grpc.Status.asRuntimeException(Status.java:526)
      at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:482)
      at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
      at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
      at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
      at com.coreos.jetcd.internal.impl.ClientConnectionManager$AuthTokenInterceptor$1$1.onClose(ClientConnectionManager.java:280)
      at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
      at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
      at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
      at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:678)
      at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
      at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
      at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
      at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:397)
      at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459)
      at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
      at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546)
      at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467)
      at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584)
      at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
      at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
      ... 3 more
  Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 485454502f
      at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
      at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:350)
      at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:251)
      at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:450)
      at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441)
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      ... 1 more
  </code></pre>
  
  <p>P.S: I tried to telnet on that port, and it worked fine. The curl also worked fine. There is no credentials I have put for the etcd.</p>