Skip to content

Blob Storage SDK hits timeout issue periodically, no indication as to why #12166

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

Closed
Petermarcu opened this issue Jun 23, 2020 · 23 comments
Closed
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. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Milestone

Comments

@Petermarcu
Copy link
Member

Reported by @Garfinkel. @Garfinkel if you could share more details of the script you used, that would be helpful.

I ran a Python script which uploads a ~30-50mb GZIP file to Azure Blob Storage through the Python SDK (v 12.3.1) using Python 3.7.5 and 3.7.7. The error I receive indicates a timeout issue with no indication why other than "server response error".

We should better indicate when issues are transient / potentially an Azure issue as opposed to a user issue.

Region = us east

... 1_CallAPI.venv\lib\site-packages\azure\core\pipeline\transport_requests_basic.py", line 284, in send

raise error

azure.core.exceptions.ServiceResponseError: ('Connection aborted.', timeout('The write operation timed out'))

@Petermarcu Petermarcu added Storage Storage Service (Queues, Blobs, Files) Service Attention Workflow: This issue is responsible by Azure service team. labels Jun 23, 2020
@ghost
Copy link

ghost commented Jun 23, 2020

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

@kaerm kaerm added Client This issue points to a problem in the data-plane of the library. bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Jun 23, 2020
@lmazuel lmazuel added this to the Backlog milestone Jun 24, 2020
@xiafu-msft
Copy link
Contributor

xiafu-msft commented Jun 25, 2020

Hi @Garfinkel

It could because of the max_single_put_size, sometime the first put blob request cannot finish within the specified/default timeout value, set max_single_put_size to a smaller value like 20*1024*1024 could be a workaround to fix the problem. We will investigate offline and see how we should modify the SDK.

@Petermarcu
Copy link
Member Author

Note I filed this on behalf of @Garfinkel

@xiafu-msft xiafu-msft added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jun 25, 2020
@xiafu-msft
Copy link
Contributor

Hi @Garfinkel

Is you problem resolved?

@xiafu-msft xiafu-msft added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Nov 19, 2020
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Nov 26, 2020
@ghost
Copy link

ghost commented Nov 26, 2020

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@erfannariman
Copy link

erfannariman commented Dec 2, 2020

We have this same issue, weird part is that it only happens on certain occasions and on certain laptops.

@ghost ghost removed the no-recent-activity There has been no recent activity on this issue. label Dec 2, 2020
@mgopez
Copy link

mgopez commented Dec 4, 2020

Getting the same issue when we have max_concurrency set within the upload_blob() method.

@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Dec 11, 2020
@ghost
Copy link

ghost commented Dec 11, 2020

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@PeterZechel
Copy link

PeterZechel commented Dec 14, 2020

Hi, I have the same bug.

Versions:
Python 3.6.9
azure-storage-blob 12.6.0

File:
Type: json
Size: 50508312

Upload parameters:
max_single_put_size is set to 20*1024*1024
timeout is set to 600

Error:
azure.core.exceptions.ServiceResponseError: ('Connection aborted.', timeout('The write operation timed out',))

Within this function multiple files are uploaded. If I change the order of the upload, it works until it comes to the large file.

@ghost ghost removed the no-recent-activity There has been no recent activity on this issue. label Dec 14, 2020
@amirbnnsr
Copy link

I am also getting a similar issue. I did notice that this issue seem to occur for certain file sizes and upload speeds, though I am not saying that they are definitely correlated.

For example, when uploading a 48MB mkv video file with around 8400Kbps upload speed leads me to this issue's error:
azure.core.exceptions.ServiceResponseError: ('Connection aborted.', timeout('The write operation timed out'))

As @xiafu-msft has suggested, changing max_single_put_size to a lower number, in my case being 10*1024*1024, did help for this particular speed and file size, but not for slower speeds. For example, uploading a 37MB mkv video with 1000Kbps upload speed. Decreasing the value of the max_single_put_size parameter further, even down to 500KB, did not help in this case.

Directly uploading via an http request (requests package) using a SAS blob url with similar header parameters as the one used within BlobClient's request {"x-ms-blob-type": "BlockBlob","x-ms-version": "2020-02-10","Content-Type": "application/octet-stream"} works without an issue for all uploads.

Versions:
Python 3.8.0
azure-storage-blob 12.6.0

Error:
azure.core.exceptions.ServiceResponseError: ('Connection aborted.', timeout('The write operation timed out',))

@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Dec 26, 2020
@ghost
Copy link

ghost commented Dec 26, 2020

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@eladg
Copy link

eladg commented Dec 29, 2020

Same issue here: azure.core.exceptions.ServiceResponseError: ('Connection aborted.', timeout('The write operation timed out'))

I'm dealing with big video files. For small files, upload works well, but I'm getting this timeout for bigger files (anything above ~15MB).

@ghost ghost removed the no-recent-activity There has been no recent activity on this issue. label Dec 29, 2020
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Jan 5, 2021
@ghost
Copy link

ghost commented Jan 5, 2021

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@lmazuel lmazuel added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. labels Jan 13, 2021
@xiafu-msft
Copy link
Contributor

Hi @amirbnnsr @hellothisisMatt @PeterZechel @eladg

We tried hard to get a write operation timeout error (we tried account in a far region, and make the max_single_put_size=60010241024, also tried to set max_single_put_size to a small value and use max_concurrency=60 to upload a big blob) while we were not able to get the error...
Can any of you try to turn on logging by copy paste this block of code https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/README.md#logging
After you turn on logging, you will get x-ms-request-id and we can search service log based on that. Sorry about the inconvenience and really appreciated for your help!

@eladg
Copy link

eladg commented Jan 25, 2021

In my case, creating BlobServiceClient with this setting helped:

{
      "max_single_put_size": 4*1024*1024, # split to 4MB chunks`
      "max_single_get_size": 4*1024*1024, # split to 4MB chunks
 }

@xiafu-msft , will try to provide logs if/when I see this issue again

@amirbnnsr
Copy link

@xiafu-msft Attached are two log files with the request header information. I have omitted Request URL and Request body from the logs.

upload_bug_logs_1000Kbps_15MB.txt are logs from uploading a 15MB video file with 1000Kbps upload speed.
upload_bug_logs_8000Kbps_52MB.txtare logs from uploading a 52MB video file with 8200Kbps upload speed.

The default value for the max_single_put_size parameter was used.

Thank you for looking into this.

upload_bug_logs_1000Kbps_15MB.txt
upload_bug_logs_8200Kbps_52MB.txt

@xiafu-msft
Copy link
Contributor

Hi @amirbnnsr
Thanks so much for the log! Could you also paste the response there, we need the response info to look up on our end

@amirbnnsr
Copy link

@xiafu-msft Unfortunately, there are no response because the timeout error happens when sending the request. The logs that I posted are actually everything that came out of azure.storage.blob

@xiafu-msft
Copy link
Contributor

xiafu-msft commented Jan 29, 2021

Hi @amirbnnsr

can you please send me your account name? Thanks!

Also have you ever tried to set read_timeout on BlobServiceClient? Though I think that’s not the problem.

@amirbnnsr
Copy link

@xiafu-msft The account name is: aiirtest

I have not tried the read_timeout, I will give that a go.

@gitjit
Copy link

gitjit commented Feb 28, 2021

I am also getting the timeout error while uploading files > 20 MB. It succeeds for smaller files. I am using Python3.6 and using the Azure Storage SDK (azure-storage-blob-12.7.1. Here is my stack overflow link. Just following the MSDN sample is showing this problem.

https://stackoverflow.com/questions/66394270/how-to-upload-large-file-100mb-to-azure-blob-storage-using-python-sdk

@xiafu-msft
Copy link
Contributor

xiafu-msft commented May 14, 2021

In the most recent patch release (azure-storage-blob 12.8.1) we had a fix about upload from a generator (#17418), hopefully that can mitigate this problem.
close this issue for now, if anyone meet this problem again feel free to comment on this issue.

@setinam
Copy link

setinam commented Jan 30, 2022

Hi, I have a ticket (TrackingID#2111100050002885) open with Storage support for about half a year and we just came to some sort of data that my help this.
We have a solution that uses parallel processes to upload files to Blob storage. randomly when we push a lot of data to the blob we get a similar write timeouts. We set timeout value on upload_blob to 600, but it did not help 100%, it probably mitigated it.
On the last exchange we came to a conclusion that E2E latency was 20s on time of timeout. This is a lot less then 600 s.
We did not yet change max_single_put_size to try to find a sweet spot for it, but we use different sizes of files so adjusting it could not be that easy.
On the Storage side there were internal server errors Network timeout error for our client azsdk-python-storage-blob/12.9.0 Python.
If server tries to return Internal server error and can not get it to the client I suppose client throws this write timeout errors.

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. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team 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