You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error is getting printed constantly in the wso2carbon.log when performing the performance test on WebSocket APIs.
[2023-02-24 20:14:48,126] ERROR - InboundWebsocketSourceHandler Exception occured while injecting websocket frames to the Synapse engine
java.lang.NullPointerException: null
Steps to Reproduce
Created mock WebSocket backed-end using tornado 1 ( python ) which echoes back
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import socket
'''
This is a simple Websocket Echo server that uses the Tornado websocket handler.
Please run `pip install tornado` with python of version 2.7.9 or greater to install tornado.
This program will echo back the reverse of whatever it recieves.
Messages are output to the terminal for debuggin purposes.
'''
class WSHandler(tornado.websocket.WebSocketHandler):
def open(self):
print ('new connection')
def on_message(self, message):
print ('message received: ',message)
#print ('sending back message: ' % message[::-1])
self.write_message(message)
application = tornado.web.Application([
(r'/ws', WSHandler),
])
if __name__ == '__main__':
http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(8888)
myIP = socket.gethostbyname(socket.gethostname())
print ('** Websocket Server Started at **' ,myIP)
tornado.ioloop.IOLoop.instance().start()
Deployed a WebSocket API with the aforementioned BE endpoint ( ws://localhost:8888/ws )
Conducted a load test by invoking the WebSocket endpoint by executing the below script in parallel and we could notice the above error trace a few times in the wso2carbon log after executing the script for a few minutes ( ~ 10 minutes ).
#!/bin/bash
for i in `seq 1 3000`
do
echo "Looping ... number $i";
wscat --connect ws://localhost:9099/testws/1.0?access_token=<JWT_TOKEN> -w 1 -x '{ "hello" : "world"}';
done | tee test_wscat_out.txt
Affected Component
APIM
Version
3.2.0
Environment Details (with versions)
No response
Relevant Log Output
TID: [-1234] [] [2023-03-03 16:04:23,678] ERROR {org.wso2.carbon.inbound.endpoint.protocol.websocket.InboundWebsocketSourceHandler} - Exception occured while injecting websocket frames to the Synapse engine java.lang.NullPointerException
at org.wso2.carbon.inbound.endpoint.protocol.websocket.management.WebsocketSubscriberPathManager.removeChannelContext(WebsocketSubscriberPathManager.java:79)
at org.wso2.carbon.inbound.endpoint.protocol.websocket.InboundWebsocketSourceHandler.handleClientWebsocketChannelTermination(InboundWebsocketSourceHandler.java:571)
at org.wso2.carbon.inbound.endpoint.protocol.websocket.InboundWebsocketSourceHandler.handleWebSocketFrame(InboundWebsocketSourceHandler.java:393)
at org.wso2.carbon.inbound.endpoint.protocol.websocket.InboundWebsocketSourceHandler.channelRead(InboundWebsocketSourceHandler.java:167)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at org.wso2.carbon.apimgt.gateway.handlers.WebsocketInboundHandler.channelRead_aroundBody4(WebsocketInboundHandler.java:298)
at org.wso2.carbon.apimgt.gateway.handlers.WebsocketInboundHandler.channelRead(WebsocketInboundHandler.java:155)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
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:1410)
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:919)
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:997)
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:834)
Related Issues
No response
Suggested Labels
No response
The text was updated successfully, but these errors were encountered:
Description
The following error is getting printed constantly in the wso2carbon.log when performing the performance test on WebSocket APIs.
Steps to Reproduce
Deployed a WebSocket API with the aforementioned BE endpoint ( ws://localhost:8888/ws )
Conducted a load test by invoking the WebSocket endpoint by executing the below script in parallel and we could notice the above error trace a few times in the wso2carbon log after executing the script for a few minutes ( ~ 10 minutes ).
Affected Component
APIM
Version
3.2.0
Environment Details (with versions)
No response
Relevant Log Output
Related Issues
No response
Suggested Labels
No response
The text was updated successfully, but these errors were encountered: