jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

NPE with websocket java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.io.RetainableByteBuffer.hasRemaining()" because "this.networkBuffer" is null

Open olamy opened this issue 8 months ago • 1 comments
trafficstars

Jetty version(s) 12.0.16

Jetty Environment When using Jenkins

How to reproduce? Not reproducible as is :(

Feb 24, 2025 3:34:38 AM FINE org.eclipse.jetty.websocket.core.WebSocketConnection fillAndParse
Error during fillAndParse() java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.io.RetainableByteBuffer.hasRemaining()" because "this.networkBuffer" is null

Or


Feb 24, 2025 3:34:38 AM FINE org.eclipse.jetty.websocket.core.WebSocketCoreSession processConnectionError
processConnectionError WebSocketCoreSession@1e4875b6{SERVER,WebSocketSessionState@71a0b388{CLOSED,i=NO-OP,o=NO-OP,c={1011=SERVER_ERROR, CLOSE method error: Cannot invoke "hudson.remoting.CommandTransport$CommandReceiver.terminate(java.io.IOException)" becaus}},[wss://jenkins/wscontrollers/,null,true.[]],af=true,i/o=4096/4096,fs=65536}->JettyWebSocketFrameHandler@23c8275d[jenkins.websocket.Jetty12EE9Provider$2]
java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.io.RetainableByteBuffer.hasRemaining()" because "this.networkBuffer" is null
	at Jenkins Main ClassLoader//org.eclipse.jetty.websocket.core.WebSocketConnection.fillAndParse(WebSocketConnection.java:438)
	at Jenkins Main ClassLoader//org.eclipse.jetty.websocket.core.WebSocketConnection.onOpen(WebSocketConnection.java:533)
	at Jenkins Main ClassLoader//org.eclipse.jetty.io.AbstractEndPoint.upgrade(AbstractEndPoint.java:435)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.internal.HttpConnection$HttpStreamOverHTTP1.succeeded(HttpConnection.java:1529)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.HttpStream$Wrapper.succeeded(HttpStream.java:227)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.internal.CompletionStreamWrapper.succeeded(CompletionStreamWrapper.java:45)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.HttpStream$Wrapper.succeeded(HttpStream.java:227)
	at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.SessionHandler$SessionStreamWrapper.succeeded(SessionHandler.java:122)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.completeStream(HttpChannelState.java:771)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:697)
	at Jenkins Main ClassLoader//org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:418)
	at Jenkins Main ClassLoader//org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at Jenkins Main ClassLoader//org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at Jenkins Main ClassLoader//org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:1583)

olamy avatar Feb 24 '25 06:02 olamy

I'm getting a similar error with 12.0.19 with Spring Boot 3.3.x with the standard graceful shutdown hook :

NullPointerException
Cannot invoke "org.eclipse.jetty.io.RetainableByteBuffer.hasRemaining()" because "this.this$0._encryptedInput" is null
org.eclipse.jetty.io.ssl.SslConnection$SslEndPoint in isInputShutdown at line 1464
org.eclipse.jetty.io.ssl.SslConnection in onFillable at line 387
org.eclipse.jetty.io.ssl.SslConnection$2 in succeeded at line 150
org.eclipse.jetty.io.FillInterest in fillable at line 99
org.eclipse.jetty.io.SelectableChannelEndPoint$1 in run at line 53
java.util.concurrent.ThreadPerTaskExecutor$TaskRunner in run at line 291
java.lang.VirtualThread in run at line 466

jebeaudet avatar May 07 '25 13:05 jebeaudet

@jebeaudet This seems to be a separate issue entirely, could you please open a separate issue for this. Possibly related to https://github.com/jetty/jetty.project/pull/12896.

Edit: opened https://github.com/jetty/jetty.project/issues/13263 for this

lachlan-roberts avatar Jun 19 '25 13:06 lachlan-roberts