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

java.lang.NullPointerException in SessionHandler.checkRequestedSessionId() #9181

Closed
halibobo1205 opened this issue Jan 17, 2023 · 8 comments · Fixed by #9346
Closed

java.lang.NullPointerException in SessionHandler.checkRequestedSessionId() #9181

halibobo1205 opened this issue Jan 17, 2023 · 8 comments · Fixed by #9346
Assignees

Comments

@halibobo1205
Copy link

Jetty version(s)
9.4.49.v20220914

Java version/vendor (use: java -version)
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (build 25.302-b08, mixed mode)
OS type/version
Linux 3.10.0-1160.36.2.el7.x86_64

Description

    (HttpChannel.java:776) null java.lang.NullPointerException: null
	at org.eclipse.jetty.server.session.SessionHandler.checkRequestedSessionId(SessionHandler.java:1733)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.lang.Thread.run(Thread.java:748)

How to reproduce?

@halibobo1205 halibobo1205 added the Bug For general bugs on Jetty side label Jan 17, 2023
@forfreeday
Copy link

I have encountered the same exception

@joakime
Copy link
Contributor

joakime commented Jan 17, 2023

Jetty 9 is at End of Community Support.

Does this happen to you on Jetty 10 or Jetty 11?

@janbartel janbartel self-assigned this Jan 17, 2023
@janbartel
Copy link
Contributor

@halibobo1205 that is a weird looking stacktrace, are some parts missing? Can you describe how you are running jetty (standalone, embedded, etc etc), any particular configuration you have, what kind of request it was handling at the time, any logs around that time etc. Preferably a small project that reproduces the problem. Need more info.

@joakime joakime added End-of-Life release and removed Bug For general bugs on Jetty side labels Jan 18, 2023
@halibobo1205
Copy link
Author

It looks like shadowserver is doing a scan visit, which happens once a day.
org.eclipse.jetty:jetty-server:9.4.11.v20180605 is OK.

@janbartel
Copy link
Contributor

@halibobo1205 what is the url of these requests? The only thing I can see in the code is that if there's something wrong with the url or maybe the request then we might return null for HttpServlet.getRequestURI when the SessionHandler is looking for the JSESSIONID on the url (because there is no JSESSIONID present as a cookie). Presenting the full request with headers etc would be helpful.

@halibobo1205
Copy link
Author

@halibobo1205 what is the url of these requests? The only thing I can see in the code is that if there's something wrong with the url or maybe the request then we might return null for HttpServlet.getRequestURI when the SessionHandler is looking for the JSESSIONID on the url (because there is no JSESSIONID present as a cookie). Presenting the full request with headers etc would be helpful.

Hi, here is the log

00:47:32.222 DEBUG [qtp1483281450-50-acceptor-0@113711ef-ServerConnector@2ec59814{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}] o.e.j.s.ConnectionLimit onAccepting (1+3) < 800 java.nio.channels.SocketChannel[connected local=/10.60.101.75:8090 remote=/64.62.197.40:24967]
00:47:32.223 DEBUG [qtp1483281450-1056] o.e.j.s.HttpChannel new HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0} -> SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=0}->,null,HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0}
00:47:32.223 DEBUG [qtp1483281450-1056] o.e.j.s.HttpConnection New HTTP Connection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=0}->
00:47:32.223 DEBUG [qtp1483281450-1056] o.e.j.s.ConnectionLimit onOpened (0+4) < 800 HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=0}->HttpConnection@66096513[p=HttpParser{s=START,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0}
00:47:32.223 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=START,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0} onFillable enter HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0} null
00:47:32.223 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=START,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0} filled 276 HeapByteBuffer@352f499e[p=0,l=276,c=8192,r=276]={<<<CONNECT www.shadowserver....nection: Keep-Alive\r\n\r\n>>>data":"be...0000000}
00:47:32.223 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=START,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0} parse HeapByteBuffer@352f499e[p=0,l=276,c=8192,r=276]={<<<CONNECT www.shadowserver....nection: Keep-Alive\r\n\r\n>>>data":"be...0000000} {}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel REQUEST for www.shadowserver.org:443 on HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=IDLE,uri=www.shadowserver.org:443,age=0}
CONNECT www.shadowserver.org:443 HTTP/1.1
Host: www.shadowserver.org^M
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36^M
Connection: keep-alive^M
Pragma: no-cache^M
Proxy-Connection: Keep-Alive^M
^M

00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=CONTENT,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=IDLE,uri=www.shadowserver.org:443,age=0} parsed true HttpParser{s=CONTENT,0 of -1}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection releaseRequestBuffer HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=0/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=CONTENT,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=IDLE,uri=www.shadowserver.org:443,age=0}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel handle www.shadowserver.org:443 HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=IDLE,uri=www.shadowserver.org:443,age=0}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannelState handling HttpChannelState@2221cc84{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel action DISPATCH HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=0}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.Server REQUEST CONNECT / on HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=0}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.h.ContextHandler scope null||/ @ o.e.j.s.ServletContextHandler@2ead86fc{/,null,AVAILABLE}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.h.ContextHandler context=||/ @ o.e.j.s.ServletContextHandler@2ead86fc{/,null,AVAILABLE}
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.session Entering scope org.eclipse.jetty.server.session.SessionHandler1201142367==dftMaxIdleSec=-1, dispatch=REQUEST asyncstarted=false
00:47:32.224 DEBUG [qtp1483281450-1043] o.e.j.s.session Leaving scope org.eclipse.jetty.server.session.SessionHandler1201142367==dftMaxIdleSec=-1 dispatch=REQUEST, async=false, session=null, oldsession=null, oldsessionhandler=null
00:47:32.225 WARN [qtp1483281450-1043] o.e.j.s.HttpChannel null
java.lang.NullPointerException: null
at org.eclipse.jetty.server.session.SessionHandler.checkRequestedSessionId(SessionHandler.java:1733)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.lang.Thread.run(Thread.java:748)
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannelState thrownException s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0
java.lang.NullPointerException: null
at org.eclipse.jetty.server.session.SessionHandler.checkRequestedSessionId(SessionHandler.java:1733)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.lang.Thread.run(Thread.java:748)
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannelState sendError HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannelState unhandle HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=true i=true al=0}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannelState nextAction(false) SEND_ERROR HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel action SEND_ERROR HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=1}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=2/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=CONTENT,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=1} filled 0 HeapByteBuffer@25f45919[p=0,l=0,c=8192,r=0]={<<<>>>GET /wall...b2a985f}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=2/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=CONTENT,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=1} parse HeapByteBuffer@25f45919[p=0,l=0,c=8192,r=0]={<<<>>>GET /wall...b2a985f} {}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel onContentComplete HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=1}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel onRequestComplete HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=1}
00:47:32.225 DEBUG [qtp1483281450-1043] o.e.j.s.HttpInput HttpInputOverHTTP@42092a60[c=0,q=0,[0]=null,s=STREAM] addContent EOF
00:47:32.226 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=2/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=END,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=2} parsed false HttpParser{s=END,0 of -1}
00:47:32.226 DEBUG [qtp1483281450-1043] o.e.j.s.HttpConnection releaseRequestBuffer HttpConnection@66096513::SocketChannelEndPoint@3e956744{l=/10.60.101.75:8090,r=/64.62.197.40:24967,OPEN,fill=-,flush=-,to=2/30000}{io=0/0,kio=0,kro=1}->HttpConnection@66096513[p=HttpParser{s=END,0 of -1},g=HttpGenerator@a8521be{s=START}]=>HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=2}
00:47:32.226 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannelState completing HttpChannelState@2221cc84{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=false al=0}
00:47:32.226 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel sendResponse info=null content=DirectByteBuffer@74c33109[p=0,l=0,c=32768,r=0]={<<<>>>{"pending...\x00\x00\x00\x00\x00\x00\x00} complete=true committing=true callback=org.eclipse.jetty.util.Callback$3@1fdb162b
00:47:32.226 DEBUG [qtp1483281450-1043] o.e.j.s.HttpChannel COMMIT for null on HttpChannelOverHttp@7c220844{s=HttpChannelState@2221cc84{s=HANDLING rs=COMPLETING os=COMMITTED is=IDLE awp=false se=false i=false al=0},r=1,c=false/false,a=HANDLING,uri=www.shadowserver.org:443,age=2}
500 null HTTP/1.1
^M

@slovdahl
Copy link
Contributor

slovdahl commented Feb 13, 2023

I have seen the same exception in our logs. Thanks for the log @halibobo1205, using this snippet it's trivial to reproduce the NPE against an embedded Jetty running in Spring Boot locally on port 8080:

echo 'CONNECT www.shadowserver.org:443 HTTP/1.1
Host: www.shadowserver.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Connection: keep-alive
Pragma: no-cache
Proxy-Connection: Keep-Alive

' | nc localhost 8080

@janbartel
Copy link
Contributor

Thanks, the log from @halibobo1205 was very informative. Investigating now. However remember that, if you're using jetty-9.4 that is EOL, so I'll be fixing the NPE in jetty-10 onwards.

janbartel added a commit that referenced this issue Feb 15, 2023
Cherry pick back to 9.4
@joakime joakime changed the title Jetty 9 java.lang.NullPointerException SessionHandler.checkRequestedSessionId(SessionHandler.java:1733) java.lang.NullPointerException in SessionHandler.checkRequestedSessionId() Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants