When i am trying to run a scenario with more than 2 threads, getting below error. It works fine with 1 and 2 threads.
Sampler:
Response code:Non HTTP response code: javax.net.ssl.SSLHandshakeException
Response message:Non HTTP response message: Remote host closed connection during handshake
Related
I am doing a python service call in the apache airflow job, the POST call is straight forward, but after 5 minutes , it fails with this error "Remote end closed connection without response".
res = requests.post(url, verify=False, auth=token) //The server responds in 5 to 10 minutes after it process few items
Note : The same call works fine using the "CURL" command. Received response after 8 minutes consistently
I am trying to understand who is closing the connection? Is it Client side, Server side or Apache airflow? As CURL command works fine, the server side seems to be fine. Do I need to change my client side python request call timeout etc or Apache airflow side changes?
I made it work using TCPKeepAliveAdapter. Here is the code now,
import requests
from requests_toolbelt.adapters.socket_options import TCPKeepAliveAdapter
session = requests.Session()
keep_alive = TCPKeepAliveAdapter(idle=120, count=120, interval=60)//We are telling server that am alive.After 2 minutes it starts pinging server 120 times with 1 minute interval.
session.mount("https://", keep_alive)
res = session.post(url, verify=False, auth=token))
//How do I send Request in Robot Framework It Gives 500 server error
//This is the request body that I want to send
{
"destinationFaxNumber": "9546599326",
"documentCount": 1
}
*** Variables ***
${base_Url}= https://07du47r041.execute-api.us.com/dev/v1/outbound
*** Test Cases ***
Send Fax Request
${headers}= create dictionary Authorization=${Token} Content-Type=application/json
#${file_data}= Get Binary File D:TestCases/SendFax.json //commented
${body}= create dictionary destinationFaxNumber=9546599326 documentCount=1
create session faxsession ${base_Url} headers=${headers}
log to console ${body}
${response}= Post On Session faxsession /fax data=${body} headers=${headers}
However I'm getting below error
HTTP Error: 500 Server Error: Internal Server Error for url: https://07du47r041.execute-api.us.com/dev/v1/outbound/fax
If postman works and RF does not, the request payload is 99.99% at fault. Capture network traffic with succesful and failing requests and compare what is different.
For example, if you have access to linux box or any machine with netcat, start nc on some port and point the url from postman and rf into that NC socket and see the request differences right in the console of nc.
We have a gRPC server in NodeJs with Nest running on separate port 3001, and when we call this from the Node client it works fine. But one of our microservice is in.NETCore when we try to call it gives us the below error. Currently, we are stuck at the 3,4 point. if someone can guide us it will be very helpful.
1. Status(StatusCode="Unimplemented", Detail="The server does not implement the method", ResponseCode: "404")
2. Status(StatusCode="Internal", Detail="Bad gRPC response. Response protocol downgraded to HTTP/1.1.")
3. An error occurred while sending the request. Http2ConnectionException: The HTTP/2 server sent invalid data on the connection. HTTP/2 error code 'PROTOCOL_ERROR' (0x1).
4. An error occurred while sending the request. IOException: The request was aborted. Http2ConnectionException: The HTTP/2 server sent invalid data on the connection. HTTP/2 error code 'PROTOCOL_ERROR' (0x1).
What we have tried,
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
On startup we use the Kestrel with listening to Http1,
options.ListenLocalhost(5000, o => o.Protocols = HttpProtocols.Http1);
Added HttpClientHandler configuration for certificate and SslProtocols
So I am building few mock servers to simulate servers that are involved in actual code.
Since there are few handshakes happening between servers during authentication process, it essentially looks like a ping pong between servers.
Here is how it looks --
Server1 -> Connect api on Server 2
Authorize on Server 1 <- Connect api on Server 2
Authorize on Server 1 -> Calls /Callback Endpoint on Server 1
<- Server 1 sends OK to Server 2(ends handshake with OK)
With this in mind I have following code written to simulate the handshake
# Server 2 (main.py)
#app.get("/v1/connect")
def connect():
httpx.get("server1/authorize")
#app.get("/callback")
def do_callback():
return "OK"
#Server 1 (main.py)
#app.get("/v1/authorize")
def do_authorize():
httpx.get("server1/callback")
But I notice error when I try to start the interactions between Server 1 and 2 by calling Connect endpoint on Server2, Server 1 throws httpcore exception while Server 2 tries to call Server 1's authorize endpoint
Any idea what is wrong here
I am using fastApi to build the mockservers
I have the standard code for sending out http request. Using http.globalAgent.
I set my maxSockets be 2500.
And then when I send out multiple requests at once, I get this error:
['{'code':'ECONNRESET'}']
However, if I sent out the request after a bit of timeout between each request, then it works.
So, questions are:
1) what does ECONNRESET really mean? Why this error happen?
2) How to send out multiple requests instantly without getting that error?
original code to send out multiple requests:
// I'm using Seq()
Seq().
seq(function() {
this(null, ['p1','p2','p3','p4','p5']);
})
.flatten(false)
.parEach(fuctnion(data) {
// send out request
sendRemoteRequest(data); // a function that uses http.request
})
.seq(function(data) {
console.log("done");
})
ECONNRESET basically means that the remote server has closed the connection. I assume it only allows a certain number of concurrent connections and if that limit is reached it just drops the connection, resulting in a ECONNRESET in your program.