reactor / reactor-netty

TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
https://projectreactor.io
Apache License 2.0
2.6k stars 645 forks source link

NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null #3350

Closed rady66 closed 3 months ago

rady66 commented 3 months ago

Expected Behavior

Not sure I can give much details how to reproduce that but it is an error we see in the spring web flux app logs

Actual Behavior

java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null at java.base/java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) at reactor.netty.internal.util.MapUtils.computeIfAbsent(MapUtils.java:62) at reactor.netty.http.server.MicrometerHttpServerMetricsRecorder.incrementErrorsCount(MicrometerHttpServerMetricsRecorder.java:138) at reactor.netty.http.server.AbstractHttpServerMetricsHandler.recordException(AbstractHttpServerMetricsHandler.java:318) at reactor.netty.http.server.AbstractHttpServerMetricsHandler.exceptionCaught(AbstractHttpServerMetricsHandler.java:283) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireExceptionCaught(CombinedChannelDuplexHandler.java:424) at io.netty.channel.ChannelHandlerAdapter.exceptionCaught(ChannelHandlerAdapter.java:92) at io.netty.channel.CombinedChannelDuplexHandler$1.fireExceptionCaught(CombinedChannelDuplexHandler.java:145) at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:143) at io.netty.channel.CombinedChannelDuplexHandler.exceptionCaught(CombinedChannelDuplexHandler.java:231) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317) at io.netty.handler.ssl.SslHandler.exceptionCaught(SslHandler.java:1202) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:447) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) 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:1583)

Steps to Reproduce

@Test
public void repoCase() {

}

Possible Solution

Your Environment

rady66 commented 3 months ago

This might help:

javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown

stackTrace = {StackTraceElement[34]@18654} 0 = {StackTraceElement@18655} "java.base/sun.security.ssl.Alert.createSSLException(Alert.java:130)" 1 = {StackTraceElement@18656} "java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)" 2 = {StackTraceElement@18657} "java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:365)" 3 = {StackTraceElement@18658} "java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:287)" 4 = {StackTraceElement@18659} "java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:204)" 5 = {StackTraceElement@18660} "java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)" 6 = {StackTraceElement@18661} "java.base/sun.security.ssl.SSLEngineImpl.decode(SSLEngineImpl.java:736)" 7 = {StackTraceElement@18662} "java.base/sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:691)" 8 = {StackTraceElement@18663} "java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:506)" 9 = {StackTraceElement@18664} "java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:482)" 10 = {StackTraceElement@18665} "java.base/javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:679)" 11 = {StackTraceElement@18666} "io.netty.handler.ssl.SslHandler$SslEngineType$3.unwrap(SslHandler.java:308)" 12 = {StackTraceElement@18667} "io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1443)" 13 = {StackTraceElement@18668} "io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1336)" 14 = {StackTraceElement@18669} "io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1385)" 15 = {StackTraceElement@18670} "io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)" 16 = {StackTraceElement@18671} "io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)" 17 = {StackTraceElement@18672} "io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)" 18 = {StackTraceElement@18673} "io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)" 19 = {StackTraceElement@18674} "io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)" 20 = {StackTraceElement@18675} "io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)" 21 = {StackTraceElement@18676} "io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407)" 22 = {StackTraceElement@18677} "io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)" 23 = {StackTraceElement@18678} "io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)" 24 = {StackTraceElement@18679} "io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)" 25 = {StackTraceElement@18680} "io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)" 26 = {StackTraceElement@18681} "io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)" 27 = {StackTraceElement@18682} "io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)" 28 = {StackTraceElement@18683} "io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)" 29 = {StackTraceElement@18684} "io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)" 30 = {StackTraceElement@18685} "io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)" 31 = {StackTraceElement@18686} "io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)" 32 = {StackTraceElement@18687} "io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)" 33 = {StackTraceElement@18688} "java.base/java.lang.Thread.run(Thread.java:1583)"

violetagg commented 3 months ago

@rady66 Thanks for the report. This is a regression caused by #3211