[Need Help] Websocket auto crash right before checing send message text

Dear there,

I’m stuck on using Websocket with Gatling

Gatling version: 3.0.3
Scala version: 2.12.8

My problem is websocket connection is crashed before I execute checking send message text.

My scenario:

Login (OK=1 KO=0 )
listChannels (OK=1 KO=0 )
Get Authentication Token (OK=1 KO=0 )
WsOpen (OK=1 KO=0 )
Check text message (OK=0 KO=1 )
---- Errors --------------------------------------------------------------------
WebSocket crashed while waiting for check: 1 (50.00%)
Ws close: Client issued close order but WebSocket was already 1 (50.00%)
crashed:

Gatling Logs:

16:23:56.166 [gatling-http-1-2] DEBUG io.gatling.http.action.ws.WsListener - Received response to WebSocket CONNECT: 101 Switching Protocols DefaultHttpHeaders[Upgrade: websocket, Connection: Upgrade, Sec-WebSocket-Accept: K1nW924jMzS9IpN2Nekhce5y5Co=, Sec-WebSocket-Protocol: chat, Sec-WebSocket-Extensions: permessage-deflate, content-length: 0]
16:23:56.168 [gatling-http-1-2] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=1
16:23:56.168 [gatling-http-1-2] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=85
16:23:56.168 [GatlingSystem-akka.actor.default-dispatcher-3] DEBUG i.gatling.http.action.ws.fsm.WsActor - Connected, no checks, performing onConnected action before performing next action
16:23:56.169 [gatling-http-1-2] DEBUG i.g.h.client.impl.WebSocketHandler - Read msg=TextWebSocketFrame(data: PooledUnsafeDirectByteBuf(ridx: 0, widx: 85, cap: 85))
16:23:56.170 [gatling-http-1-2] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=1
16:23:56.170 [gatling-http-1-2] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=2
16:23:56.170 [gatling-http-1-2] DEBUG i.g.h.client.impl.WebSocketHandler - Read msg=TextWebSocketFrame(data: PooledUnsafeDirectByteBuf(ridx: 0, widx: 2, cap: 2))
16:23:56.171 [GatlingSystem-akka.actor.default-dispatcher-3] INFO i.g.http.action.ws.WsSendTextFrame - Sending text frame {“text”: “Hello”, “creator”: “5dc928a745fd15421b175b5e”, “type”: “text”, “channel”: “5dbbe8e42792896f408fcf81”} with websocket ‘gatling.http.webSocket’: Scenario ‘Testing OpenPaaS chat send a message’, UserId #1
16:23:56.173 [GatlingSystem-akka.actor.default-dispatcher-3] DEBUG i.gatling.http.action.ws.fsm.WsActor - Send text frame Send message {“text”: “Hello”, “creator”: “5dc928a745fd15421b175b5e”, “type”: “text”, “channel”: “5dbbe8e42792896f408fcf81”}
16:23:56.174 [GatlingSystem-akka.actor.default-dispatcher-3] DEBUG i.gatling.http.action.ws.fsm.WsActor - Trigger check after sending text frame
16:23:56.174 [gatling-http-1-2] DEBUG i.g.h.client.impl.WebSocketHandler - ctx.write msg=TextWebSocketFrame(data: UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf(ridx: 0, widx: 111, cap: 333))
16:23:56.196 [gatling-http-1-2] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=1 length=93
16:23:56.198 [gatling-http-1-2] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=8
16:23:56.198 [gatling-http-1-2] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=0
16:23:56.198 [gatling-http-1-2] DEBUG i.g.h.client.impl.WebSocketHandler - Read msg=CloseWebSocketFrame(data: PooledUnsafeDirectByteBuf(ridx: 0, widx: 0, cap: 0))
16:23:56.200 [gatling-http-1-2] DEBUG i.g.h.client.impl.WebSocketHandler - channelInactive
16:23:56.200 [GatlingSystem-akka.actor.default-dispatcher-3] DEBUG i.gatling.http.action.ws.fsm.WsActor - WebSocket remotely closed while waiting for checks
16:23:56.201 [GatlingSystem-akka.actor.default-dispatcher-3] DEBUG i.gatling.http.action.ws.fsm.WsActor - WebSocket crashed, performing next action
16:23:56.202 [GatlingSystem-akka.actor.default-dispatcher-3] INFO io.gatling.http.action.ws.WsClose - Closing websocket ‘gatling.http.webSocket’: Scenario ‘Testing OpenPaaS chat send a message’, UserId #1
16:23:56.204 [GatlingSystem-akka.actor.default-dispatcher-3] DEBUG io.gatling.core.action.Exit - End user #1
16:23:56.205 [GatlingSystem-akka.actor.default-dispatcher-4] INFO i.g.core.controller.inject.Injector - All users of scenario Testing OpenPaaS chat send a message are stopped
16:23:56.205 [GatlingSystem-akka.actor.default-dispatcher-4] INFO i.g.core.controller.inject.Injector - Stopping

Do you have any idea or clue why the connection is crashed before I close it?
Thanks in advanced!!

Your server sent you an opcode 8 which is a connection close and thus Netty closed the socket.

http://tools.ietf.org/html/rfc6455#section-5.2

I found the problem from your clue.

Reason why websocket server disconnect

Thank you!!