Non-descript error: Gevent + Connection Pooling + SSL

We're getting this error randomly from our production environment. I can't seem to reproduce locally yet. We use requests w/ Gevent, and I'm wondering if it's some kind of race condition where the socket isn't ready to use, but gets handed out by the connection pool. Still investigating, but figured I'd post this anyways. It would be nice to get a better error from pyopenssl.

We're using Requests 2.7.0, installed using pip.

```
 File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 508, in post
   return self.request('POST', url, data=data, json=json, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 465, in request
   resp = self.send(prep, **send_kwargs)
 File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 573, in send
   r = adapter.send(request, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 370, in send
   timeout=timeout
 File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 533, in urlopen
   conn = self._get_conn(timeout=pool_timeout)
 File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 239, in _get_conn
   conn.close()
 File "/usr/lib/python2.7/httplib.py", line 780, in close
   self.sock.close()   # close it manually... there may be other refs
 File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 213, in close
   return self.connection.shutdown()
Error: []
```


Hi there! Please provide additional information as requested in our [Contributing.md file](https://github.com/kennethreitz/requests/blob/master/CONTRIBUTING.md): specifically, **what version of Requests** you're using and **how you installed it**.


You've updated your original post to say requests 2.8.1 from pip. I'm afraid I don't believe that's right, because your traceback apparently raises from line 213 of `pyopenssl.py`. As of v2.8.1, [line 213 of `pyopenssl.py` is blank](https://github.com/kennethreitz/requests/blob/18a6b601100db978f3a6e191816456e75bc47e0f/requests/packages/urllib3/contrib/pyopenssl.py#L213).


You're right. Wrong stacktrace. This one is from 2.8.1.

```
 File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 508, in post
   :param \*\*kwargs: Optional arguments that ``request`` takes.
 File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 465, in request
   'allow_redirects': allow_redirects,
 File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 573, in send
   start = datetime.utcnow()
 File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 370, in send
   timeout=timeout
 File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 533, in urlopen

 File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 239, in _get_conn

 File "/usr/lib/python2.7/httplib.py", line 780, in close
   self.sock.close()   # close it manually... there may be other refs
 File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 213, in close

Error: []
```


That stack trace _cannot_ be right: an empty line can't throw an exception. 


In fact, that stack trace is bizarre: it involves several lines that are not code. Your system seems to be in a very bad way. 


Yeah, don't know why that is.

We had the same error with Requests 2.7.0. The original stack trace up top is from 2.7.0.


Yeah when you've fixed your installation and have a stacktrace from 2.8.1. that makes sense, I'll take a look at this. I don't see a reason to do so before that if lines of the stacktrace are missing.