Forum Discussion

AkshayMandloi's avatar
AkshayMandloi
New Contributor
2 years ago

ReadyAPI Error: Error getting response; java.net.SocketException: Connection reset by peer

Hi,

I am sending a POST request with an attachment of size like 14 mb and getting different errors randomly (cycles between these two) like:
- Error getting response; java.net.SocketException: Connection reset by peer.
Error getting response; java.net.SocketException: An established connection was aborted by the software in your host machine.
I have also attached a screenshot, please take a look.

 

I cannot share the request information in this forum, but I can give some details:

- I am using ReadyAPI 3.43.1. Sending an attachment with the request of size around 13-14 mb.
- I'm on the my company's connection.
- I have gone through many questions/threads on the community and out of community but didn't find any solution so far.
- I have already tried adding -Dsoapui.https.protocols=SSLv3,TLSv1.2 and/or -Djava.net.preferIPv4Stack=true to the ReadyAPI.vmoptions file and it doesn't work.
-  I have already tried adding set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.https.protocols=SSLv3,TLSv1.2 to the ready-api.bat file and it doesn't work.
- I have already tried using http instead of https for the endpoint URL and same behavior.

FYI, same works with POSTMAN.

What could be the reason for this error: Company's connection/firewall/antivirus is blocking the connection? ReadyAPI issue? Or something else?


Can someone please advice me on this issue?
Please let me know if you need additional information.

 

Thanks in advance!

-Akshay

7 Replies

  • Hey Akshay,

     

    I feel your frustration dealing with these perplexing errors. Your thorough description of the problem is commendable, making it easier to provide assistance. It's definitely a head-scratcher, but I'll try to shed some light on it.

     

    The "java.net.SocketException: Connection reset by peer" error usually indicates a sudden termination of the network connection during data transfer. Given that it works in POSTMAN, it's less likely to be a ReadyAPI issue. Here's my take:

     

    1. Firewall/Antivirus: It's plausible that your company's security measures or antivirus software might be interfering with the connection. Verify if any security software is actively scanning or blocking your requests.

    2. Proxy Settings: Check if there are any proxy settings affecting your connection in ReadyAPI. Sometimes, these settings can cause connection issues.

    3. Timeouts: Look into increasing timeout settings, both on your client-side and the server-side. Large attachments might need more time to process.

    4. Server Configuration: Ensure that the server you're sending the request to is properly configured to handle larger attachments.

    5. Network Stability: Investigate if your company's network experiences intermittent connectivity issues during large data transfers.

    6. ReadyAPI Updates: Make sure you're using the latest version of ReadyAPI, as updates often include bug fixes and improvements.

     

    Additionally, if you'd like to explore alternative tools for testing your APIs, you might consider checking out Andersen for its expertise in API testing and troubleshooting. They could provide valuable insights and solutions tailored to your specific needs.

     

    Lastly, since you mentioned it works in POSTMAN, consider using it as a temporary workaround while you troubleshoot the ReadyAPI issue. Hopefully, one of these suggestions will help you pinpoint and resolve the problem.

  • JoostDG's avatar
    JoostDG
    Frequent Contributor

    Hi AkshayMandloi . Did you trye in your test case options to specify you socket timeout limit. Default is zero = 60.000 ms (= 1 minute).

  • Hi JoostDG, Thanks for your reply.
    I tried increasing the test case timeout limit and still same behavior.

    • JoostDG's avatar
      JoostDG
      Frequent Contributor

      From your logs, can you see how long exactly the request takes before the connection closes? If it happens each time after 60 seconds there might still be something with your socket timeout settings.  

       

      Note that there is test case timeout and socket timeout. I referred to the latter. See 

      https://support.smartbear.com/readyapi/docs/functional/ui/case.html#options (The duration (ms) of a connection socket. The empty value or 0 sets the timeout to 1 minute.)

       

      Or your rest service (or any other downstream service) has a timeout set whichafter it closes down. But if you say it consistently fails for ReadyAPI but works for Postmen than this cannot be the case.

      • JoostDG's avatar
        JoostDG
        Frequent Contributor

        Or perhaps another instance of readyAPI is already running on your machine? I know you can open ReadyAPI 2 times, but that does cause some instabilities I noticed... It could be a reason for the exotic "An established connection was aborted by the software in your host machine."  Not tested it, but just trying to get some clues...

  • Hi JoostDG 
    It's not showing in the logs that how long the request is taking before the connection closes. Just giving the error.
    Also, I have tried increasing the Socket and Testcase timeout limits to 2 mins and still no luck.
    Please see the attached screenshot for logs and Test case Options.



    I'm only running 1 instance of ReadyAPI. So running multiple instance is not the case.
    And yeah it consistently fails for ReadyAPI but working for Postman.

     

  • Thanks stefanheisl for your detailed response.

     

    After in contact back and forth with ReadyAPI support team for more than a month or so, they have confirmed it's an ISSUE in ReadyAPI and forwarded the issue to he development team for the fix.

     

    -Akshay