wso2ei 6.4 - Return HTTP/1.1 202 Accepted - wso2-enterprise-integrator

We are migrating services from WSO2 ESB 4.7 to WSO2 EI 6.4.
The problem is that when we call a ESB soap 1.1 service this is executed correctly but the client (SoapUI in this case) receives a response code 202 with content-lenght 0 (status: HTTP/1.1 202 Accepted).
In carbon log we find this record: [SynapseWorker-2] WARN {org.apache.synapse.transport.passthru.PassThroughHttpSender} - Trying to submit a response to an already closed connection : http-incoming-1
The problem is not a timeout and if we change in SoapUI the content-type from request header we have a response with content-lenght > 0
Axis2 is configurated with text/xml enable both in Message Formatters and in Message Builders.
Any idea in order to address/solve the problem?

The message you're seeing: "Trying to submit a response to an already closed connection", could mean that the connection was closed by either the client or some operation inside your proxy/sequence. Are you handling the errors within the fault sequence?
I usually get unexpected 202 when there's something wrong with my service. It can be unhandled errors, not having <respond/> on the right place (like when using clone/iterate mediators without minding the threading behind these)...
My suggestion is to use logs and also debugging to see what happens before you get the 202 or the "Trying to submit a response to an already closed connection" message.

Related

JMeter response 504 Gateway time-out?

I am trying to perform a test against an endpoint with 1 thread. I configured a HTTP request with JSON Monk endpoint URL using JMEter.
But when I run the test I get Response code:504 in the Sampler result. The same when I use the URL in a browser I get also 504 Gateway Time-out
Can anyone help me with this issue? - I tried in another pc and I got the same error!
I have installed JMeter correctly and my code is correct too. I am working on a Windows 10.
HTTP Request:
As per HTTP Status Code 504 description
The HyperText Transfer Protocol (HTTP) 504 Gateway Timeout server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request.
Note: A Gateway might refer to different things in networking and a 504 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through.
So it indicates the problem with the server you're trying to test, if you own the website - go and fix it, if you know someone who is responsible for it - inform him/her/them.
There is nothing you can do from JMeter perspective. If you know how response should look like you can use a Dummy Sampler to return this response so you could play with the response data
By the way, it's down for me as well:

http upgrade failed with status code 400 in jmeter websocket sampler

I have used the websocket open connection sampler request in my project.
URL: wss://sip-qa.forestreettelco.com:11443
while executing the jmeter script getting the Response message:"http upgrade failed with status code 400"
Please help me.enter image description here
As per HTTP Status Code 400 description
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
So my expectation is that you're sending the wrong request which doesn't match what your server expects. As it is not publicly available I cannot come up with the proper configuration, however I believe you should start with normal HTTP Request sampler and add the following Headers to the request:
Connection: Upgrade
Upgrade: websocket
Whatever other headers which real browser sends like Sec-WebSocket-Protocol, Sec-WebSocket-Version, Sec-WebSocket-Key, etc.
The headers can be added using HTTP Header Manager
You can capture browser traffic using built-in browser developer tools or an external sniffer tool like Wireshark.
Once you will be sending the same sequence of the same requests you should get the same responses as for the real browser.

JMeter 1 user Response code: Non HTTP response code: java.net.ConnectionException Response message: Non HTTP response

I'm trying to learn load testing with JMeter(Very new). Using the tutorial to Build a Web Test Plan on the JMeter website and another youtube tutorial, I created an HTTP GET request to hit www.google.com/ but I get the following result:
Thread Name: Thread Group 1-1
Sample Start: 2018-07-16 12:44:09 CDT
Load time: 64018
Connect Time: 64018
Latency: 0
Size in bytes: 2390
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 2390
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
Here's my request:
link to image since I don't have 10 reputation yet
Looking around other people are getting this issue but their issue is after 250+ users: Response code: Non HTTP response code: java.net.ConnectException Response message: Non HTTP response message: Connection timed out: connect
However, I'm only trying to use one user and one thread, and I couldn't find anyone having the same error with only one user.
I set the Client implementation to HttpClient4 like the second answer suggests from jmeter Non HTTP response code: java.net.ConnectException but I still get the same issue.
Thanks in advance!
Answer Turns out it was because of our proxy server. Which was strange because I'm able to send request via postman and get responses. But I switched to a computer not on the proxy and everything is working now.
The problem you try to connect with HTTPS protocol on non HTTPS port as 80
there is a strong convention to send http over port 80 and https over port 443
Remove port number value and it'll use default 443 port
Looking at the screenshot , you are using 80 as port number for https connection that is the reason why you are getting non http response code. Give port number as 443 or leave it blank ..
TO know more about Load testing with JMeter please follow this link

JMeter error : java.net.SocketException: Unexpected end of file from server

I have read and tried the solutions shared in the previous posts for this error but nothing helped me to fix this. Kindly help.
I am making a HTTPS API call. A very simple call which accepts a 2 KB JSON message via POST method and sends a one word acknowledgement. It works perfectly fine in Postman tool. In JMeter, no. of threads (users) is kept as 25. It works perfectly fine one time with all 25 success response and at times getting few failure response as
Response code: Non HTTP response code: java.net.SocketException
Response message: Non HTTP response message: Unexpected end of file from server
No consistency at all. I have also tried with both enabling and disabling "use keepalive" checkbox. Both giving me all success one time ; few/all failure at another time with the above error. Please help. Thank you.
Below are the JMeter settings:
HTTP Header Manager : Content-Type - application/json
HTTPRequest sampler : protocol - HTTPS
Server Name or IP : project server name
Method : POST
PATH : The required path with https authentication details passed as parameters
IMPLEMENTATION : Set to JAVA (HTTPCLIENT4 was giving me “443 failed to respond” error)
Add header
Connection Keep-Alive
Both errors (Java implementation and Apache HTTPClient4 implementation), are essentially saying the same thing: The server closed the connection, without providing any response. I think there could be the following reasons:
Authentication problem. If server side checks authentication before processing a request (e.g. using Spring), it may be rejecting your request, it may be not bothering with any response if authentication is not considered correct.
Request Issue. Some less noticeable properties of the request you send via Jmeter are different from what you send in Postman. It could be some minor thing with formatting, or some headers server expects. Some of such inconsistencies can also cause Load Balancer (if you use one) to reject request before it's delivered to the server.
Certificate issues. Since you are using HTTPS, you need to make sure your certificate is setup correctly on JMeter side.
So I suggest:
Review server logs and see if your request makes it to the server. If yes, you might be able to see how it was rejected. If not, you need to trace back and see who rejected it (LB, authentication, etc)
Compare headers and body sent by JMeter vs Postman line to line (use TCPDump for example to obtain it).

HTTP response code to indicate a bug in the client

I am developing both client and server. During development, I would the server to detect when the client appears to be buggy (send invalid data, omits mandatory parameter, etc, etc).
Is there a standard HTTP response code to indicate this? Or several, depending on the nature of the bug?
Or should I just use my own response code?
e.g 2001 I'm afraid I can't do that, Dave?
or 666 Mwuuuuuuhahhahahahahahahaha
HTTP 400 "Bad Request"
https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1
The 400 (Bad Request) status code indicates that the server cannot or
will not process the request due to something that is perceived to be
a client error (e.g., malformed request syntax, invalid request
message framing, or deceptive request routing).

Resources