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

[Storage] No exception about connection error during blob download #16980

Closed
kekatahi opened this issue Feb 27, 2021 · 6 comments
Closed

[Storage] No exception about connection error during blob download #16980

kekatahi opened this issue Feb 27, 2021 · 6 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@kekatahi
Copy link

  • 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.

  1. Create the blob ( at least more than 15MB . this need for step 3).
  2. Start to download using download_blob method.
  3. during the download, we make connectivity error explicitly. I did turn off the Wifi on my laptop
  4. 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;
  5. 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.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 27, 2021
@annatisch annatisch added bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Mar 1, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 1, 2021
@annatisch
Copy link
Member

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 #16783

@annatisch annatisch added the Service Attention Workflow: This issue is responsible by Azure service team. label Mar 1, 2021
@ghost
Copy link

ghost commented Mar 1, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details
  • 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.

  1. Create the blob ( at least more than 15MB . this need for step 3).
  2. Start to download using download_blob method.
  3. during the download, we make connectivity error explicitly. I did turn off the Wifi on my laptop
  4. 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;
  5. 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.

Author: kekatahi
Assignees: -
Labels:

Client, Service Attention, Storage, bug

Milestone: -

@kekatahi
Copy link
Author

@annatisch Thank you for your response. Do you have the ETA of #16783 ?

@kekatahi
Copy link
Author

kekatahi commented Apr 1, 2021

#17078

@tasherif-msft
Copy link
Contributor

Hi @kekatahi we are incorporating this fix in our next release while also ensuring that we retry on an interrupted download.
I will update you once the new packages are released (which should be tomorrow or early next week)

@tasherif-msft
Copy link
Contributor

The fix has been merged here 7e74cb3 it will be available in the release happening in the next couple of days!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

3 participants