Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling/Catching a socket hang up error #4254

Open
sanvipy opened this issue Feb 28, 2018 · 11 comments
Open

Handling/Catching a socket hang up error #4254

sanvipy opened this issue Feb 28, 2018 · 11 comments

Comments

@sanvipy
Copy link

sanvipy commented Feb 28, 2018

App Details:

Postman for Windows
Version 5.5.3
win32 6.1.7601 / x64

Issue Report:

  1. Did you encounter this recently, or has this bug always been there: Been there always
  2. Expected behaviour: Test shouldnt end, or atleast an error should be logged on failure
  3. Console logs Error: socket hang up
  4. Screenshots (if applicable)
    image

So Im running into Socket hang up errors very randomly.
While Im ok with the error itself, what bothers me is that the whole test pack stops without marking an error.

Is there any possible way to catch this socket error gracefully? ( So that I can flag that step as a Fail and continue with next steps). I do use try catch blocks in Tests part, but obviously that doesnt help in case of socket hang up error.

@prashantagarwal
Copy link

@sanvipy Thanks for reporting this. We will look into this issue.

@jpSimkins
Copy link

jpSimkins commented May 10, 2018

I am experiencing this a lot now on Ubuntu 18.04. I have a local API I am working on and it works fine everywhere but on Postman. Currently testing with a browser for now as this happens a lot and the app is now unusable.

@stevetursi
Copy link

+1
I sat down today to write retry logic in my collection to catch "socket hang up" and other network issues (such as "could not get any response") and found that the test scripts don't run when these issues occur. There appears to be no workaround.

@yanafomicheva
Copy link

Good day!
I use Postman for Windows Version 7.23.0.
I have a collection with a big count of requests(540). When I click it manually in the builder - it looks okay.
But when I run collection - I always get "Error: socket hang up" in random places.
QIP Shot - Screen 035

@asi-postman
Copy link

Hi team, We another user that is experiencing the same type of issue.

When running collections in collection runner, Randomly few of the requests are failing.
When I compare with the same successful request, failed request is missing “Content-Length” header.

image
image

@thepeej-pwhite6
Copy link

I'm also having random Socket Hang Up errors. I'm running three tests in parallel using newman. Whilst I can see the socket hangups in the terminal window, I am using htmlextra as a reporter. I can clearly see on a request that works it has content-length yet on one that doesn't work, content-length is missing (see screenshots below). So I concur with @asi-postman that there appears to be a difference which may be causing the http server to reject.

Working:
image

Not Working:
image

@Mahonnant
Copy link

I am also encountering this issue, more so when working from home through a VPN and sending requests to our test environment (which is to be expected). The problem is not the socket hangups themselves but the fact that, when running a set of test cases in the Runner it completely stops the run instead of flagging the test case as Failed and continuing with the following test case.
This is highly disrupting for our workflow, we have a 700+ collection of test cases to run when doing non-regression and this bug forces us to run it multiple times until we happen to have a stable enough connection to not have any socket hangup errors.

@ed-mak
Copy link

ed-mak commented Aug 27, 2020

Just adding to the numbers here. I am also encountering this issue and it is very disruptive. We need either a workaround so we can implement a retry mechanic (which is a shoddy process already) or have it fixed. Or ideally both so we can save ourselves in the future if something similar to this occurs.

@preethammavin preethammavin added this to Pending triage in Runtime Triage and Development via automation Aug 27, 2020
@DannyDainton
Copy link
Contributor

Hey @ed-mak , @Mahonnant, @thepeej-pwhite6

Is this still an issue for you in the latest version of the platform?

If so, is it possible to provide some reproducible steps in a newer version - I understand it's been a while and the platform has moved on since then but I wanted to revisit the issue.

@sunilvp
Copy link

sunilvp commented Apr 28, 2022

Saw this error in mac , but even if we are getting this error can we catch it programatically and not fail the runner altogether ?

@lucianamerege
Copy link

Hey @ed-mak , @Mahonnant, @thepeej-pwhite6

Is this still an issue for you in the latest version of the platform?

If so, is it possible to provide some reproducible steps in a newer version - I understand it's been a while and the platform has moved on since then but I wanted to revisit the issue.

I am using the latest version (updated it yesterday while trying to solve this issue). I don't know how to provide reproducible steps, but I can provide a screenshot :p
image
This url is supposed to be inaccessible, and until recently returned an error 403 (which is what we wanted and what our collection expected to pass the tests). For a couple of weeks now we've been getting this error, though, which stops the whole collection and monitor from running.
We tried doing workarounds such as catching the error in the pre-request script since the testing phase isn't even reached when this error occurs, but there hasn't been a solution besides skipping the test for now.
Is there anything else I can say to help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests