Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException When Calling ProxyUtils.isHEAD #360

Open
mjallday opened this issue Mar 24, 2017 · 4 comments
Open

NullPointerException When Calling ProxyUtils.isHEAD #360

mjallday opened this issue Mar 24, 2017 · 4 comments

Comments

@mjallday
Copy link

mjallday commented Mar 24, 2017

https://github.com/adamfisk/LittleProxy/blob/master/src/main/java/org/littleshoot/proxy/impl/ProxyUtils.java#L346-L348

Looks like somehow the request that comes in is null.

java.lang.NullPointerException
at org.littleshoot.proxy.impl.ProxyUtils.isHEAD (ProxyUtils.java:347)
at org.littleshoot.proxy.impl.ClientToProxyConnection.respond (ClientToProxyConnection.java:446)
at org.littleshoot.proxy.impl.ProxyToServerConnection.respondWith (ProxyToServerConnection.java:519)
at org.littleshoot.proxy.impl.ProxyToServerConnection.readHTTPInitial (ProxyToServerConnection.java:238)
at org.littleshoot.proxy.impl.ProxyToServerConnection.readHTTPInitial (ProxyToServerConnection.java:77)
at org.littleshoot.proxy.impl.ProxyConnection.readHTTP (ProxyConnection.java:135)
at org.littleshoot.proxy.impl.ProxyConnection.read (ProxyConnection.java:120)
at org.littleshoot.proxy.impl.ProxyToServerConnection.read (ProxyToServerConnection.java:214)
at org.littleshoot.proxy.impl.ProxyConnection.channelRead0 (ProxyConnection.java:587)
at io.netty.channel.SimpleChannelInboundHandler.channelRead (SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.handler.timeout.IdleStateHandler.channelRead (IdleStateHandler.java:287)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead (ChannelInboundHandlerAdapter.java:86)
at org.littleshoot.proxy.impl.ProxyConnection$ResponseReadMonitor.channelRead (ProxyConnection.java:738)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead (MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead (MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead (ByteToMessageDecoder.java:293)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead (ByteToMessageDecoder.java:280)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode (ByteToMessageDecoder.java:396)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead (ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead (ChannelInboundHandlerAdapter.java:86)
at org.littleshoot.proxy.impl.ProxyConnection$BytesReadMonitor.channelRead (ProxyConnection.java:692)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.handler.ssl.SslHandler.unwrap (SslHandler.java:1228)
at io.netty.handler.ssl.SslHandler.decode (SslHandler.java:1039)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode (ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead (ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:341)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead (DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:349)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead (DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read (AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey (NioEventLoop.java:642)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized (NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys (NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run (NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run (SingleThreadEventExecutor.java:858)
at java.lang.Thread.run (Thread.java:745)

LP 1.1.2
Netty 4.1.8.Final

@mjallday
Copy link
Author

To give a little more context: It looks like this is an issue when using a chained proxy

2017-03-27 18:57:34.173 ERROR 6 [trace=,span=,tenant=] --- [oServerWorker-3] o.l.proxy.impl.ProxyToServerConnection   : (AWAITING_INITIAL) [id: 0xd819132d, L:/172.17.0.3:52874 - R:/159.203.115.41:22225]: Caught an exception on ProxyToServerConnection

java.lang.NullPointerException: null
        at org.littleshoot.proxy.impl.ProxyUtils.isHEAD(ProxyUtils.java:347)

@Pareshdanej
Copy link

Is it fixed ?

@Gordiievskyi
Copy link

Is it fixed ?

Seams not, raw 446 - https://github.com/adamfisk/LittleProxy/blob/master/src/main/java/org/littleshoot/proxy/impl/ClientToProxyConnection.java is still without check of currentHttpRequest != null and mr is not merged

@mjallday @yuriyshafranyuk1 guys do you know anything on this ?

@mjallday
Copy link
Author

I believe we fixed it in our fork verygoodsecurity#5

The main fork appears close to dead/un maintained :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants