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

put_blob results in [('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')] error #54

Closed
timfpark opened this issue Oct 15, 2015 · 3 comments

Comments

@timfpark
Copy link
Member

I have a pretty simple scenario in which I am trying to write a set of blobs into Blob Storage ala:

blobService = BlobService(account_name=os.environ["STORAGE_ACCOUNT"], account_key=os.environ["STORAGE_ACCESS_KEY"])
blobService.create_container(CONTAINER, x_ms_blob_public_access='container')

....

for resultSet in collectedResultSets:
    container = str(resultSet[0])
    json = str(build_json(resultSet))
    print container
    blobService.put_blob(CONTAINER, container, json, "BlockBlob")

This intermittently results in the following error:

Traceback (most recent call last):
File "", line 5, in
File "/Library/Python/2.7/site-packages/azure/storage/blob/blobservice.py", line 883, in put_blob
self._perform_request(request)
File "/Library/Python/2.7/site-packages/azure/storage/storageclient.py", line 171, in _perform_request
resp = self._filter(request)
File "/Library/Python/2.7/site-packages/azure/storage/storageclient.py", line 160, in _perform_request_worker
return self._httpclient.perform_request(request)
File "/Library/Python/2.7/site-packages/azure/storage/_http/httpclient.py", line 181, in perform_request
self.send_request_body(connection, request.body)
File "/Library/Python/2.7/site-packages/azure/storage/_http/httpclient.py", line 143, in send_request_body
connection.send(request_body)
File "/Library/Python/2.7/site-packages/azure/storage/_http/requestsclient.py", line 81, in send
self.response = self.session.request(self.method, self.uri, data=request_body, headers=self.headers, timeout=self.timeout)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, *_send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, *_kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 370, in send
timeout=timeout
File "/Library/Python/2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
body=body, headers=headers)
File "/Library/Python/2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1035, in _send_request
self.endheaders(body)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 826, in send
self.sock.sendall(data)
File "/Library/Python/2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 220, in sendall
sent = self._send_until_done(data[total_sent:total_sent+SSL_WRITE_BLOCKSIZE])
File "/Library/Python/2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 206, in _send_until_done
return self.connection.send(data)
File "/Library/Python/2.7/site-packages/OpenSSL/SSL.py", line 1271, in send
self._raise_ssl_error(self._ssl, result)
File "/Library/Python/2.7/site-packages/OpenSSL/SSL.py", line 1187, in _raise_ssl_error
_raise_current_error()
File "/Library/Python/2.7/site-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'SSL3_WRITE_PENDING', 'bad write retry')]

@emgerner-msft
Copy link
Member

I've done some researching and while I'm not positive, most of the information I'm finding indicates this is not an Azure storage issue. For example, see this issue in the urllib3 repository.

Could you check your Python version and make sure it has all the latest bug fixes? I can see you're on 2.7, but not the specific bug fix version.

@lmazuel
Copy link
Member

lmazuel commented Dec 21, 2015

Hi,

As @emgerner-msft said, it seems to be a bug in urllib3 embedded in requests 2.8.1. The bug report indicates a bug fix in urllib3 1.12. Since now requests 2.9.1 is released with urllib 1.13.1 inside, could you try again and confirm that your problem is solved?

@timfpark
Copy link
Member Author

Yup - seemed to vanish with the upgrade to this. Thanks!

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

No branches or pull requests

3 participants