scalapb / scalapb-grpcweb

Grpcweb support for ScalaPB (Experimental!)
42 stars 12 forks source link

Failure(io.grpc.StatusRuntimeException: UNKNOWN: Http response at 400 or 500 level)) #198

Closed burakakca closed 1 year ago

burakakca commented 1 year ago

GrpcWebClientExampleCode

    val stub =
      RouteGuideGrpcWeb.stub(Channels.grpcwebChannel("https://localhost:8980"))

     stub.getFeature(Point(409146138, -746188906)).onComplete { f => println("Result" -> f) }

Error;

Hello world!
System.scala:391 (Unary,Failure(io.grpc.StatusRuntimeException: UNKNOWN: Http response at 400 or 500 level))
index.js:38          POST https://localhost:8980/routeguide.RouteGuide/GetFeature net::ERR_SSL_PROTOCOL_ERROR

Server is zio-grpc/routeguide example

Server Error;

Jan 11, 2023 12:52:23 PM io.grpc.netty.NettyServerTransport notifyTerminated
INFO: Transport failed
io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 1603010200010001fc030308de3e44f88df68f6559205d4f
    at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:109)
    at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.readClientPrefaceString(Http2ConnectionHandler.java:321)
    at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:247)
    at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:453)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:1589)
thesamet commented 1 year ago

Can you add few more details about the environment? I see you use https and not http? Are you using envoy proxy how is that configured?

burakakca commented 1 year ago

Server is uses HTTPS I couldn't pass the insecure mode (http)

thesamet commented 1 year ago

Is envoy providing the https encryption? Can you provide your envoy.yaml then? Can you explain "I couldn't pass the insecure mode" ?

burakakca commented 1 year ago

Sorry, my mistake of the configurations