question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NullPointerException: Cannot invoke "io.netty.handler.codec.http.HttpRequest.headers()" because "nettyRequest" is null

See original GitHub issue

HttpRequest is a Nullable param in HttpServerOperations.

Invoking nettyRequest.headers() as part of the HttpServerOperations constructor resulting in NPE.

reactor-http-epoll-36              reactor.netty.transport.ServerTransport -- [56fa470a, L:/17.171.24.85:40004 ! R:/17.157.16.116:42506] onUncaughtException(SimpleConnection{channel=[id: 0x56fa470a, L:/17.171.24.85:40004 ! R:/17.157.16.116:42506]})
java.lang.NullPointerException: Cannot invoke "io.netty.handler.codec.http.HttpRequest.headers()" because "nettyRequest" is null
	at reactor.netty.http.server.HttpServerOperations.<init>(HttpServerOperations.java:166) ~[reactor-netty-http-1.0.17.jar!/:1.0.17]
	at reactor.netty.http.server.HttpServerOperations$FailedHttpServerRequest.<init>(HttpServerOperations.java:925) ~[reactor-netty-http-1.0.17.jar!/:1.0.17]
	at reactor.netty.http.server.HttpServerOperations.sendDecodingFailures(HttpServerOperations.java:769) ~[reactor-netty-http-1.0.17.jar!/:1.0.17]
	at reactor.netty.http.server.HttpTrafficHandler.sendDecodingFailures(HttpTrafficHandler.java:271) ~[reactor-netty-http-1.0.17.jar!/:1.0.17]
	at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:231) ~[reactor-netty-http-1.0.17.jar!/:1.0.17]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at reactor.netty.http.server.logging.AccessLogHandlerH1.channelRead(AccessLogHandlerH1.java:58) ~[reactor-netty-http-1.0.17.jar!/:1.0.17]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327) ~[netty-codec-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299) ~[netty-codec-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480) ~[netty-transport-classes-epoll-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[netty-transport-classes-epoll-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.75.Final.jar!/:4.1.75.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.75.Final.jar!/:4.1.75.Final]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

  • Netty version - 1.0.17

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jakshay21commented, Aug 16, 2022

@violetagg @pderop Sorry I was away and missed the notifications around the recent comments.

I’ll bump up the version and retest, and will reopen if the issue resurfaces again.

Thank you.

2reactions
jakshay21commented, Aug 12, 2022

Hi @pderop, Sorry forgot to attach the stack trace before. I’ve updated the description.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HttpRequest coming as null resulting in java.lang ... - GitHub
Running reactor-netty-http:1.0.2 resulting in below error intermittently. Any suggestions? ... Final] at io.netty.handler.codec.
Read more >
Netty 4 Decoder Issue - java - Stack Overflow
I am developing an smpp-based application. However I have noticed something while I am decoding the smpp PDU. When the app receives few...
Read more >
Example usage for io.netty.handler.codec.http HttpRequest ...
In this page you can find the example usage for io.netty.handler.codec.http HttpRequest headers. Prototype. HttpHeaders headers();. Source Link. Document.
Read more >
io.netty.handler.codec.http.HttpRequest.headers java code ...
private static boolean isUpgradeRequest(HttpObject msg) { return msg instanceof HttpRequest && ((HttpRequest) msg).headers().get(HttpHeaderNames.UPGRADE) !
Read more >
Playing on LAN, help please! : r/Minecraft - Reddit
I'm getting the error: internal exception io.netty.handler.codec.encoderexception: java.lang.nullpointerexception: cannot invoke…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found