Jmeter 500 error in TCP - jmeter

I have set up the TCP Sampler to pass XML data and check the return.
I have the proper IP address, the port number is correct and the data is ready.
However, I consistently get this error:
Thread Name: BasicCheck 1-1
Sample Start: 2017-09-06 00:12:59 UTC
Load time: 3520
Connect Time: 1
Latency: 0
Size in bytes: 0
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 0
Response headers:
SampleResult fields:
ContentType:
DataEncoding: windows-1252
I know the server is up and operating, I put the username and password in the TCP Sampler locations in Jmeter. I simply don't know why I'm getting this error.
This is on a windows machine (obviously) to a straight TCP server.

You need to do the following things to make this work:
In the TCP sampler make EOL Byte value=10 Timeout (Miliseconds) for response enter value as 5000 or 10000
Add user defined variables which you want to send as text through TCP sampler. Ex. I want to send the text as ${STX}2017105557|SAMPLEMESSAGE|Message2${ETX} so STX and ETX are my user defined variables.
Add a bean shell PreProcessor to convert values to ASCII format.
Sample code:
[String STX = URLDecoder.decode(vars.get("STX"), "ASCII");
vars.put("STX",STX);
String ETX = URLDecoder.decode(vars.get("ETX"), "ASCII");
vars.put("ETX",ETX);][1]
Jmeter Script should look like this:
TCP Sampler Jmeter script

Related

jmeter showing error when HTTP request is made

I am totally new to JMeter, when I tried to test a website.
The test result was like this
Thread Name: Thread Group 1-1
Sample Start: 2018-06-19 10:18:49 IST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 1176
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 1176
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Expected closing bracket for IPv6
What might be the issue?
Looks like improper HTTP Request sampler configuration, for instance you put some not supported character into "Server Name or IP" field. Well-behaved request should look like:
Another option is placing the full URL into "Path" field like
However the best option will be just recording your test scenario using JMeter's HTTP(S) Test Script Recorder, this way JMeter will generate appropriate HTTP Request samplers which you will be able to replay with increased number of threads. See Apache JMeter proxy Step-by-step guide for comprehensive instructions.
Alternatively you can use JMeter Chrome Extension - in this case you will not have to set up proxies and worry about SSL certificates.

Response code: Non HTTP response code: java.net.ConnectException Response message: Non HTTP response message: Connection timed out: connect

I am executing one script using Jmeter for load testing.I am getting error in between lets say for eg. If I applied load of 500users, till 250 users threads are running successfully then error comes of connection timed out error.Then, again it running successful for some of threads then error.
Code is as follow:-
Thread Name: Thread Group 1-1274
Sample Start: 2016-09-15 15:02:13 IST
Load time: 21004
Connect Time: 21004
Latency: 0
Size in bytes: 2206
Headers size in bytes: 0
Body size in bytes: 2206
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.ConnectException
Response message: Non HTTP response message: Connection timed out: connect
Response headers:
HTTPSampleResult fields:
ContentType:
DataEncoding: null
I need to break the server.
Can anyone help me for this?
Issue might be due to server hanging, so check the server components health.
Otherwise you could be consuming all ephemeral ports which you can extend by tuning the tcp stacks.
As per Kiril S. answer, on windows it would be:
On Windows:
Follow this guide to check if ports might be an issue:
https://msdn.microsoft.com/en-us/library/aa560610(v=bts.20).aspx.
Check 2 parameters:
MaxUserPort: increase it to max 65534.
TcpTimedWaitDelay, which defines how long the ports are staying in TIME_WAIT state after use. Change that value to 30
On Linux:
Set in sysctl.conf:
net.ipv4.ip_local_port_range=1025 65000

Response message: Non HTTP response message: no protocol: Response code: Non HTTP response code: java.net.MalformedURLException

Try to execute a script using Jmeter 3.0.I am getting error for eg. If I applied load of 50 users, Ramp-up period 10, loop Count: 1
Thread Name: Thread Group 1-2
Sample Start: 1970-01-01 05:30:00 IST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 729
Headers size in bytes: 0
Body size in bytes: 729
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.MalformedURLException
Response message: Non HTTP response message: no protocol:
Response headers:
HTTPSampleResult fields:
ContentType:
DataEncoding: null
Can anyone help me why this type of error is showing?
I tried few requests for the above URL in JMeter 3.2. It seems like there is no issue in the URL. Please make sure the configuration of HTTP sampler as shown below.
HTTP Sampler Configuration
You can use Redirect Automatically option also.
Output
Jmeter; how to solve the error 'Non HTTP response message: unknown protocol'
If it is an https protocol include it in the text box and if not, you can leave it blank.
Type the url of the page in the text box labelled server name.
You can include the path if there is, in the path text box.
See image in the link below;
https://i.stack.imgur.com/PPum7.png

Internal Server Error in Jmeter Script

I am trying to create Jmeter scripts for our PEGA application, but every time reply scripts fail due to the following issue.
Can anyone help?
Thread Name: Thread Group 1-1
Sample Start: 2016-08-12 08:38:58 IST
Load time: 604
Connect Time: 0
Latency: 603
Size in bytes: 4267
Headers size in bytes: 1774
Body size in bytes: 2493
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: Internal Server Error
Response headers:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Set-Cookie: Pega-RULES=H79D7E64B2C531F36AE825FC87DA355F5; Version=1; Comment="PegaRULES session tracking"; Path=/prweb
You most probably are missing either a header or a cookie.
I suggest you try to record traffic using JMeter Test Script Recorder so that you avoid any missing header.
See:
http://jmeter.apache.org/usermanual/component_reference.html#HTTP(S)_Test_Script_Recorder
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
This way you won't miss any header or cookie.
Then see what need to be variabilized using Post Processor and variables (${varName})

jmeter response code 204 and can't get content

I am doing a websocket stress test through jmeter2.9.
When I send a request and response with a "light" json. the result is ok.
But when the response json contains a base64 png(about 360kb) . jmeter return code 204 No content (probably timeout).
Is my jmeter need some config here, or something else wrong.
If someone know something about this please teach me.
complete info:
Thread Name: threadgroup 1-1
Sample Start: 2013-07-17 15:36:06 CST
Load time: 20000
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Response code: 204
Response message: No content (probably timeout).
Response headers:
SampleResult fields:
ContentType:
DataEncoding:
Check if you are using Cache manager, there seems to be a (bug) in Jmeter that sets the response code to HTTP Code '204' ("No Response") while, there is no outgoing request, the information is retrieved from the Cache, try disabling cache manager and lets see if you can reproduce it then.
This could be because of the unhandled exception, response being larger than the maximum message size specified in the plugin code, etc. The exception which you see will be thrown if no response has been received from the server after predefined timeout.
Here is another WebSocket plugin for JMeter which might work for you
Link: https://github.com/maciejzaleski/JMeter
Features:
Supports HTTS/HTTPS (ws/wss) version of the WebSocket protocol
Option to ignore SSL certificate errors
Streaming allows for a single connection to remain open for the duration of the test
Response has to match predefined regular expression
Response timeout
Response message back log (build the Sampler response from multiple server messages)
Connection could be closed if server sends a mesage matching predefined regular expression

Resources