[Storage] No exception about connection error during blob download
See original GitHub issue- Package Name:azure-storage-blob:
- Package Version:12.7.1:
- Operating System:Ubuntu 18.4 LTS:
- Python Version:python:3.8.3:
Describe the bug the data downloaded using download_blob method seems small size compare to source blob. This issue happen when the NetworkError occurred . And there are no exception when NetworkError occurred.
To Reproduce Steps to reproduce the behavior: Before that we should enable the storage analytics logs to check the NetworkError.
- Create the blob ( at least more than 15MB . this need for step 3).
- Start to download using download_blob method.
- during the download, we make connectivity error explicitly. I did turn off the Wifi on my laptop
- We see the NetworkError on Storage analytics logs like below and the dowloaded file is small size.
2.0;2021-02-25T07:00:08.9500298Z;GetBlob;NetworkError;206; - But there are no exception.
sample code
try:
connect_str = os.getenv('AZURE_STORAGE_CONNECTION_STRING')
containername = "test"
blobfilename = "test"
downloadfilepath = "./path/to/data/test"
dt_before = datetime.datetime.now()
print("Azure Blob Storage v" + __version__ + " - Python quickstart sample")
blobserviceclient = BlobServiceClient.from_connection_string(connect_str)
print("before" ,dt_before)
blobclient = blobserviceclient.get_blob_client(container=containername, blob=blobfilename)
with open(downloadfilepath, "wb") as downloadfile:downloadfile.write(blobclient.download_blob().readall())
dt_after = datetime.datetime.now()
print("after" ,dt_after)
except Exception as ex:
print('Exception:')
print(ex)
Expected behavior it should return the exception for NetworkError if the blob download incomplete.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Downloading page blob with azure.storage.blob's ... - GitHub
Downloading page blob with azure.storage.blob's BlobServiceClient fails with ConnectionReset (10054) error. #24958.
Read more >Azure Blob Storage error codes - Microsoft Learn
Error code HTTP status code User message
BlobAlreadyExists Conflict (409) The specified blob already exists.
BlobNotFound Not Found (404) The specified blob does not exist.
ContainerAlreadyExists...
Read more >When downloading from azure blob, I get "Unable to read data ...
exception - When downloading from azure blob, I get "Unable to read data from the transport connection: The connection was closed." - Stack ......
Read more >Fix file download errors - Google Chrome Help
If you try to download a file and it doesn't work, try to fix the error with these troubleshooting steps: Make sure that...
Read more >Troubleshooting | Cloud Storage
Attempting to use an authenticated browser download for non-public objects results in a 403 response. This restriction exists to prevent phishing for Google...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks for the report @kekatahi! Adding @xiafu-msft and @tasherif-msft for a closer look. Looks like it might be something in the retry streaming logic? Maybe related to https://github.com/Azure/azure-sdk-for-python/pull/16783
The fix has been merged here https://github.com/Azure/azure-sdk-for-python/commit/7e74cb317f916269c3e65b0f6691524769eacf87 it will be available in the release happening in the next couple of days!