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

Sometimes websocket sampler throwing Null response while opening socket connection

Open ravikanthperf opened this issue 10 years ago • 12 comments

Hi MaciejZaleski,

This websocket sampler is excellent and i have been waiting for this for a long time. I have downloaded and started to use this.

websockets are implemented using engine IO libraries in my application. sometimes sampler works fine and gives proper response for the requests. But sometimes it throws null response as shown below while opening websocket connection. Please give me a solution for this why it is happening intermittently. do you think that when existing connection is still open while opening another connection, is this happened?

Thread Name: Thread Group 1-1 Sample Start: 2014-05-08 22:08:11 PDT Load time: 10073 Latency: 0 Size in bytes: 2666 Headers size in bytes: 0 Body size in bytes: 2666 Sample Count: 1 Error Count: 1 Response code: Response message:

[Execution Flow]

  • Opening new connection
  • Using response message pattern ""
  • Using disconnect pattern ""
  • Waiting for the server connection for 10000 MILLISECONDS
  • Cannot connect to the remote server

[Variables]

  • Message count: 0

[Problems]

  • Unexpected error: null 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:429) org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) java.lang.Thread.run(Thread.java:722)

Response headers:

SampleResult fields: ContentType: DataEncoding: UTF-8

ravikanthperf avatar May 09 '14 05:05 ravikanthperf

can you please respond on this?

ravikanthperf avatar May 13 '14 04:05 ravikanthperf

Any resolution on the above issue? I am seeing the same error message

Thread Name: Thread Group 1-1 Sample Start: 2015-03-20 13:43:39 EDT Load time: 5015 Connect 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]

  • Opening new connection
  • Using response message pattern ""
  • Using disconnect pattern ""
  • Waiting for the server connection for 5000 MILLISECONDS
  • Cannot connect to the remote server

[Variables]

  • Message count: 0

[Problems]

  • Unexpected error: null 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)

Response headers:

SampleResult fields: ContentType: DataEncoding:

AnnaDev avatar Mar 20 '15 19:03 AnnaDev

+1

tahsintahsin avatar Jul 02 '15 11:07 tahsintahsin

+1

peer2peer avatar Aug 20 '15 12:08 peer2peer

When the thread group with many number of threads, the issue happened. But if I set the thread number as 1, the issue will never happen. What's the cause?

Thanks!!!!!!

Thread Name: Thread Group 1-2 Sample Start: 2015-08-23 10:40:31 CST Load time: 5039 Connect 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]

  • Opening new connection
  • Using response message pattern ""
  • Using disconnect pattern ""
  • Waiting for the server connection for 5000 MILLISECONDS
  • Cannot connect to the remote server

[Variables]

  • Message count: 0

[Problems]

  • Unexpected error: null 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)

Response headers:

SampleResult fields: ContentType: DataEncoding: UTF-8

peer2peer avatar Aug 23 '15 02:08 peer2peer

According to my experiences , There could be 2 reasons: 1)Server could return HTTP 500: Check your server log. if you can't, use Wireshark to see the error.

2)Server could return HTTP 400: You could override some server header or another connectionId error. Header "Host" can cause sometimes problems.

Call the same url that you generated in browser.

ceritandogan avatar Aug 28 '15 15:08 ceritandogan

Im facing also the same errors. Connection with the socket is not happening and i m getting the following errors in jmeter. [Problems]

  • Unexpected error: null 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 07:12 Raul666

+1

getsuriya avatar May 11 '16 11:05 getsuriya

when I choose this :all went well image

x00350069 avatar Jul 12 '16 07:07 x00350069

+1 using spring / sockjs / stomp

MWhyte avatar Jan 30 '17 16:01 MWhyte

@MWhyte wondering how did you configure testplan to use spring / sockjs / stomp

utsavkansara avatar Mar 29 '18 23:03 utsavkansara

+1. Having the same issue. Using spring/sockjs/stomp

kiennt23 avatar Jul 16 '18 07:07 kiennt23