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

requests.exceptions.ConnectionError: ('Connection aborted.', ResponseNotReady('Request-sent',)) #273

Closed
giantryansaul opened this issue May 4, 2015 · 3 comments
Labels
bug
Milestone

Comments

@giantryansaul
Copy link
Contributor

@giantryansaul giantryansaul commented May 4, 2015

I wanted to offer this up not as an issue, but as a solution to one that I found today.

I had a test that when run on a specific server would always fail with this unhelpful message:
requests.exceptions.ConnectionError: ('Connection aborted.', ResponseNotReady('Request-sent',))

The test had multiple requests to the same client within a single task and a colleague suspected it was something to do with the connection from the first request not being properly closed.

After a lot of playing around with timeouts and attempting to close out the first connection before the next one was sent (both of which did not solve the issue), I found a stackoverflow article with the same issue:
http://stackoverflow.com/questions/30033516/single-session-multiple-post-get-in-python-requests

The quick and dirty solution was to update to requests 2.7.0. At the time of getting this error I was on 2.6.2. I also noticed that the default version for locust is on 2.4. If you are experiencing this issue, simply update to 2.7 and you should be good!

@Horcrux
Copy link

@Horcrux Horcrux commented Aug 17, 2015

Huh, I had this same error in my own program. I simply followed this guide on updating to 2.7.0. Thanks for the tip!

@ghost
Copy link

@ghost ghost commented Aug 17, 2015

Hi @giantryansaul

Would the pip request dependency be dependant on the version of python? A 'pip install locustio' on python 2.7.10 seems to give me 'python-requests/2.7.0'. I say this, as I have been logging request headers.

'User-Agent': 'python-requests/2.7.0 CPython/2.7.10 Linux/3.10.0-229.el7.x86_64'
@giantryansaul
Copy link
Contributor Author

@giantryansaul giantryansaul commented Aug 17, 2015

@aidylewis Looking at the fix from @cgoldberg the library requirements are specified as requests>=2.4.1 and not requests=2.4.1, so your pip request may have simply found 2.7.0 as the best match with python 2.7.10. That is about the extent of my pip knowledge though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.