JMeter-WebSocketSampler icon indicating copy to clipboard operation
JMeter-WebSocketSampler copied to clipboard

WebSocket conection closed unexpectedly by the server: [1006] Read EOF

Open filipcynarski opened this issue 11 years ago • 12 comments

My sample is marked as failed because the connection has been closed unexpectedly, however my server is closing connection after 30 seconds.

Could you please add a checkbox for sample where I will be able to set ignore closed connection or when connection close do not mark as failed?

Thread Name: Movers 1-27 Sample Start: 2014-03-19 13:31:00 CET Load time: 93 Latency: 0 Size in bytes: 1882 Headers size in bytes: 0 Body size in bytes: 1882 Sample Count: 1 Error Count: 1 Response code: 1006 Response message:

[Execution Flow]

  • Reusing exising connection
  • Waiting for messages for 20000 MILLISECONDS
  • Received message #6 (3 bytes); matched response pattern
  • WebSocket conection closed unexpectedly by the server: [1006] Read EOF
  • Leaving streaming connection open

filipcynarski avatar Mar 19 '14 12:03 filipcynarski

I too, am running into this same issue, would like to upvote on a fix.

markucsb avatar Aug 29 '14 22:08 markucsb

I'm experiencing similar things when testing socket.io 1.0.

I use following flow: 1 create connection 2 send message on open socket to server (no direct response) 3 send another message to server 2 (response 3) --> heartbeat

The issue I'm experiencing with this flow is that after I use the sampler on my established connection (2) the next one failes saying the connection is closed.

Report output on 3.

Thread Name: Thread Group 1-1
Sample Start: 2014-11-19 14:08:01 CET
Load time: 0
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Response code: 
Response message: 

[Execution Flow]
 - Reusing exising connection


[Variables]
 - Message count: 1


[Problems]
 - Unexpected error: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:245)
JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:156)
JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:136)
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:431)
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:258)
java.lang.Thread.run(Unknown Source)


Response headers:


SampleResult fields:
ContentType: 
DataEncoding: UTF-8

Would you be able to fix this problem? I have really no clue where to start...

marcofranssen avatar Nov 19 '14 13:11 marcofranssen

@filipcynarski maybe you should check that your server's config. make the server's maxthread bigger.

johnny1952 avatar May 22 '15 03:05 johnny1952

I am experiencing the same issue too ... just testing with a single thread at the moment.

orrery avatar Jul 15 '15 04:07 orrery

Same issue here.

With single thread I get this error almost everytime.

When running 100+ threads this happens about 18% of the time.

jgainfort avatar Jul 24 '15 16:07 jgainfort

Not sure if it helps anyone but my issue was related to not having a cookie for the client upgrade request, sent to system under test. If your system under test requires a cookie, you will see immediate discconnects and read EOF errors. In any case, I couldn't get the Jmeter WebSocketSampler to work under this situation, and I ended up writing my own test tool using Jetty.

orrery avatar Jul 24 '15 17:07 orrery

I'm also seeing this issue the error in my case is:

ERROR - JMeter.plugins.functional.samplers.websocket.ServiceSocket: Disconnect 1006: EOF

I'm trying to use the WebSocket plugin to bench test a chat application I have 2 threads per chat each with their own WebSocketSampler. Chat durations are about 10 minutes in length and messages are sent between every 3-15seconds. For a small number of chats say 20 (40 threads) it works fine. But anything larger tends to produce these errors on a regular basis perhaps for every thread.

I'm not sure if the threads are being starved and the connections are timing out? The source of this error is not clear.

swordmaster2k avatar Jul 29 '15 15:07 swordmaster2k

Taking a look through my Tomcat log files I found the following 3 Exceptions related to this behavior:

2015-07-30 09:10:29.345 -0700 ERROR Error sending message to 24f: java.io.IOException: An established connection was aborted by the software in your host machine 2015-07-30 09:10:29.345 -0700

ERROR Error sending message to 342: java.nio.channels.ClosedChannelException

2015-07-30 09:10:29.345 -0700 ERROR Error sending message to 29c: java.io.IOException: Key must be cancelled

Googling this exceptions seems to suggest that the JMeter WebSocketSampler is not properly closing the connections.

swordmaster2k avatar Jul 30 '15 16:07 swordmaster2k

ERROR - JMeter.plugins.functional.samplers.websocket.ServiceSocket: Disconnect 1006: EOF Solution: I also had the same issue and it got fixed simply by adding a http cookie manager before the Websocket sampler. It works fine now connection are left open. but when the second request is sent i also got the following error:

[Problems]

  • Unexpected error: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED] org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:245) JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:156) JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:136) org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434) org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261) java.lang.Thread.run(Unknown Source)

Raul666 avatar Dec 08 '15 09:12 Raul666

marcofranssen did you found any solution to this problem?

Raul666 avatar Dec 08 '15 10:12 Raul666

Alls well that ends well. I figured out every puzzel and its working for me. created a test with the plugin and all errors are not gone. sending 3 requests and in between 1 ping lifesign request to keep the connection alive.

Raul666 avatar Dec 08 '15 12:12 Raul666

Not sure if it helps anyone but my issue was related to not having a cookie for the client upgrade request, sent to system under test. If your system under test requires a cookie, you will see immediate discconnects and read EOF errors. In any case, I couldn't get the Jmeter WebSocketSampler to work under this situation, and I ended up writing my own test tool using Jetty.

What type of tools exactly you made? @orrery

govinda-raj avatar Mar 06 '19 12:03 govinda-raj