在GRPC上进行响应时间测试时,我遇到了这个问题,JMeter是一个spring启动服务器。我在类似的案例中读到过,它与TLS配置有关,但在我的案例中我不确定这一点。我只有在30秒内测试大约1000个请求,然后大约950个请求是ok的200个请求和50个抛出此服务器端异常的请求时才会出现此问题。
io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 16030100890100008503038bc456665bba06cf1a9f93f4f4
at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:103) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.readClientPrefaceString(Http2ConnectionHandler.java:306) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:239) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:438) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:498) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:437) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:792) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]发布于 2021-03-01 00:46:14
字节TLS是客户端发送给服务器的第一个160301字节。
在您的例子中,服务器回答说它正在等待HTTP/2客户端前言。
这意味着您的客户端正在尝试将加密字节发送到明文服务器端口。
检查您使用的方案是否正确,必须是http,而不是https (因为服务器需要明文字节)。
或者,将服务器配置为在该端口上接受加密的字节。
https://stackoverflow.com/questions/66406446
复制相似问题