{"Message":"An error has occurred."} exactly mean/error it is - jmeter

When I have executed the JMeter load test script. I am getting "Response code: 500" and also response data
{"Message": "An error has occurred."}
I have tried with different Id's to pass the data.
Sampler Result:
Thread Name: Thread Group 1-1
Sample Start: 2019-05-11 17:45:32 IST
Load time: 36
Connect Time: 0
Latency: 36
Size in bytes: 358
Sent bytes:5783
Headers size in bytes: 322
Body size in bytes: 36
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: Internal Server Error
HTTPSampleResult fields:
ContentType: application/json; charset=utf-8
DataEncoding: utf-8
Response data:
{"Message":"An error has occurred."}
Expected Result: Should place an order(such as e-commerce)
Actual Result: Unable to place an order.

The client application gets an HTTP status code of 500 with the message "Internal Server Error" as a response for API calls. The 500 Internal Server error could be caused by an error during the execution of any policy within Edge or by an error on the target/backend server.
The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is usually returned by the server when no other error code is suitable.
https://docs.apigee.com/api-platform/troubleshoot/runtime/500-internal-server-error-0
Normally, you request is malformed and have break some logic/validation or which is not served by the server due to some error.
What can be done?:-
Execute the request manually using browser to check if there is a problem in the server in serving your request.
Your http request is not correct. Check for correlation/mandatory dynamic parameters. Use any sniffing tool like fiddler to capture two request and compare them to get the dynamic parameters and see if you have correlated them or not.

Related

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})

how to run the recorded jmeter test plan

Thread Name: Thread Group 1-1
Sample Start: 2015-01-12 12:11:16 IST
Load time: 0
Latency: 0
Size in bytes: 1080
Headers size in bytes: 0
Body size in bytes: 1080
Sample Count: 1
Error Count: 1
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Expected closing bracket for IPv6 address at index 14: /
Response headers:
HTTPSampleResult fields:
ContentType:
DataEncoding: null
I am trying to execute the recorded JMeter test plan... but its showing the error as shown above. Can anyone help me how to sort it out??
Perhaps recording issue or something connected with i.e. clash with HTTP Request Defaults.
By the way, there is an option for recording JMeter scripts right from Google Chrome browser via JMeter Chrome Extension which doesn't require to worry about proxies, SSL certificates, cookies, excluding usual patterns from recording, etc. perhaps it may be easier to use.
Error is "Response code: Non HTTP response code: java.net.URISyntaxException"
This is means url is not getting passed correctly.
Solution is,
Remove http:// from your server/ip in your http request.
While running look at the request sent. it should be http://server and not http://http://server

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