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

BlobClient.upload_blob hangs and crashes (2 in 1) #11457

Closed
AlexeyRaga opened this issue May 15, 2020 · 7 comments
Closed

BlobClient.upload_blob hangs and crashes (2 in 1) #11457

AlexeyRaga opened this issue May 15, 2020 · 7 comments
Assignees
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. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Milestone

Comments

@AlexeyRaga
Copy link

  • Package Name: azure-storage-blob
  • Package Version: 12.3.1
  • Operating System: Linux
  • Python Version: 3.7.7

Describe the bug
BlobClient.upload_blob hangs for 1.5 minutes if a metadata value contains a leading space. Then it crashes with a deep Python stack trace and ServiceRequestError exception.

It crashes much faster when a metadata value ends with a space though! Which could be a good thing if it wasn't ClientAuthenticationError exception.

To Reproduce
Steps to reproduce the behavior:

with open("requirements.txt", "rb") as data:
    test_container.upload_blob("test.txt", data, overwrite=True, metadata={'config': conf})

This fails after 1.5 minutes with ServiceRequestError when conf = " boo", and it fails with ClientAuthenticationError when conf = "boo "

Expected behavior
Metadata is validated before actually making a call, a meaningful validation exception is raised.

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 15, 2020
@lmazuel lmazuel 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. Service Attention This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 15, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 15, 2020
@ghost
Copy link

ghost commented May 15, 2020

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

@lmazuel lmazuel added this to the Backlog milestone May 15, 2020
@xiafu-msft
Copy link
Contributor

@AlexeyRaga

Thanks for reaching out and sorry that you are having this issue.
May I know the size of the blob and the region your account is located?
Thanks for the info

@AlexeyRaga
Copy link
Author

@xiafu-msft Hi, the size seems to be irrelevant (I tested on files that are from ~200B to ~30KB).
I think the problem here is in HTTP headers: metadata is sent via the headers, headers are not validated/cleaned by the API which causes the problem.

I am testing in East Australia region.

@xiafu-msft
Copy link
Contributor

Hi @AlexeyRaga

Thanks for the info! It should be a SDK bug, SDK should trim the metadata value for user before sending to the service. We will file a bug and fix it.

Does this sound good to you? Let me know how you feel about SDK trimming the prepended/appended space for you! Thanks.

@xiafu-msft
Copy link
Contributor

#11677

@AlexeyRaga
Copy link
Author

Sounds good to me.
Trimming vs. validation - doesn't matter in my use case, whatever is more canonical for Python...

@xiafu-msft
Copy link
Contributor

Thanks @AlexeyRaga for reporting this issue, this has been merged and will be released in this week.
For the other issue you opened we will dig into it!

Close this one for now, feel free to reopen it if you have any concern! Thanks again!

@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. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention 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