Python Ssl Error Timed Out
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and python the read operation timed out policies of this site About Us Learn more about Stack Overflow the ssl.sslerror: the read operation timed out boto company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags sslerror: the read operation timed out pip Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes
Aws The Read Operation Timed Out
a minute: Sign up SSLError (read operation timed out) instead of timeout when PUT using Requests up vote 1 down vote favorite I'm trying to do various REST requests to a piece of equipment using the Requests package. It is working, but on some requests, like PUTs, I'm getting a SSLError, instead of a timeout that I'm specifying. I have the urllib2 sslerror the read operation timed out code set up to retry, up to 5 times, doubling the timeout each time (1,2,4,8, 16, 32), and if I treat the SSLError as a timeout, then it will eventually pass. Here's an example, and you can see the SSLError is occurring at the pace of the timeout interval: 2013-12-10 19:41:13.208 22294 DEBUG client [-] PUT: Request for https://192.168.200.20/api/v1/global/host-name headers {'content-type': 'application/json', 'Accept': 'application/json', 'X-auth-token': u'...omitted...'} payload {'host-name': 'TestHost'} 2013-12-10 19:41:13.209 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20 2013-12-10 19:41:14.253 22294 ERROR client [-] EXCEPTION The read operation timed out <<< SSL Error 2013-12-10 19:41:14.255 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20 2013-12-10 19:41:16.301 22294 ERROR client [-] EXCEPTION The read operation timed out 2013-12-10 19:41:16.302 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20 2013-12-10 19:41:20.346 22294 ERROR client [-] EXCEPTION The read operation timed out 2013-12-10 19:41:20.348 22294 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.200.20 2013-12-10 19:41:25.845 22294 DEBUG requests.packages.urllib3.connectionpool [-] "PUT /api/v1/global/host-name HTTP/1.1" 204 0 _make_request /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:289 2013-12-10 19:41:25.846 22294 DEBUG client [-] PUT: Completed [204] As you
Sign in Pricing Blog Support Search GitHub This repository the read operation timed out s3 Watch 104 Star 1,470 Fork 287 boto/boto3 Code Issues
Sslerror The Read Operation Timed Out Aws
126 Pull requests 5 Projects 0 Pulse Graphs New issue ssl.SSLError: ('The read
Boto Timeout
operation timed out',) #185 Closed oysnow opened this Issue Jul 20, 2015 · 6 comments Projects None yet Labels bug needs-discussion http://stackoverflow.com/questions/20504367/sslerror-read-operation-timed-out-instead-of-timeout-when-put-using-requests response-needed Milestone No milestone Assignees No one assigned 4 participants oysnow commented Jul 20, 2015 Hi, sometimes, I will get the following error but most time, the program execute successfully, what does the error exactly mean and how can I get rid of https://github.com/boto/boto3/issues/185 this error? Thanks. Traceback (most recent call last): File "refresh_price_history.py", line 65, in main() File "refresh_price_history.py", line 43, in main file_to_db.update_from_last_timestamp(conn, aws_key_id, aws_secret_key) File "/home/ec2-user/CC/file_to_db.py", line 79, in update_from_last_timestamp unrecorded_prices = spot_price_pagination.get_history(ec2, start_time, end_time, p) File "/home/ec2-user/CC/spot_price_pagination.py", line 50, in get_history for page in paginator.paginate(StartTime=start_time, EndTime=end_time, ProductDescriptions=products): File "/usr/local/lib/python2.7/site-packages/botocore/paginate.py", line 83, in iter response = self.make_request(current_kwargs) File "/usr/local/lib/python2.7/site-packages/botocore/paginate.py", line 155, in make_request return self._method(current_kwargs) File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 258, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 304, in _make_api_call operation_model, request_dict) File "/usr/local/lib/python2.7/site-packages/botocore/endpoint.py", line 110, in make_request return self._send_request(request_dict, operation_model) File "/usr/local/lib/python2.7/site-packages/botocore/endpoint.py", line 139, in _send_request success_response, exception): File "/usr/local/lib/python2.7/site-packages/botocore/endpoint.py", line 203, in _needs_retry caught_exception=caught_exception) File "/usr/local/lib/python2.7/site-packages/botocore/hooks.py", line 226, in emit return self._emit(event_name, kwargs) File "/usr/local/lib/python2.7/site-packages/botocore/hooks.py", line 209, in _emit response = handler(kwargs) File "/usr/local/lib/python2.7/site-packages/botocore/retryhandler.py", line 183, in __call if self.checker(attempts, response, caught_exception
User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue17664 classification Title: ssl.SSLError has errno value of None Type: behavior Stage: Components: Versions: Python 2.7 process Status: closed http://bugs.python.org/issue17664 Resolution: not a bug Dependencies: Superseder: Assigned To: Nosy List: Paul.Wiseman, pitrou Priority: normal Keywords: Created on 2013-04-08 15:36 by Paul.Wiseman, last changed 2013-04-08 21:22 by Paul.Wiseman. This issue is now closed. Messages (3) msg186310 - (view) Author: Paul Wiseman (Paul.Wiseman) Date: 2013-04-08 15:35 I was using py2.7.3 and was getting None back for the errno attribute for an ssl.SSLError('The read operation timed out timed out'). I noticed in the 2.7.4 release notes that it sounds like there was a fix for this: Issue #12065: connect_ex() on an SSL socket now returns the original errno when the socket's timeout expires (it used to return None). I've just tested in py2.7.4 and I'm still getting None back for the errno attribute. I'm using this code to produce the the read operation error: import requests def __init__(self, exception): # First extract the real underlying exception exception = exception.args[0] # This should be ssl.SSLError super(requests.exceptions.ConnectionError, self).__init__(exception) self.strerror = exception.strerror self.errno = exception.errno requests.exceptions.ConnectionError.__init__ = __init__ timeout_val = 0.2 while True: try: print requests.get("https://google.com", timeout=timeout_val) except requests.exceptions.SSLError as err: print err.strerror print err.errno break except Exception as err: print "Got %s: %s" % (err.__class__.__name__, err) timeout_val /= 2 msg186321 - (view) Author: Antoine Pitrou (pitrou) * Date: 2013-04-08 18:10 The issue you mention is unrelated. connect_ex() returns an error code, it doesn't raise an exception. As for the errno attribute being None, this is because most SSLErrors don't correspond to a single OS error. And in the case you mention ("the read operation timed out"), it isn't an OS error at all: it's simply a select() call timing out. msg186350 - (view) Author: Paul Wiseman (Paul.Wiseman) Date: 2013-04-08 21:22 Ah ok, thanks for clearing that up. I thought there'd have been a socket.error with ETIMEDOUT raised as the underlying exception, similar to if it times out during the non-ssl part of the request History Date User Action Args 2013-04-0821:22:16P