Skip to content

upload_blob no response just hangs #46383

@AndreRicardo-Zoetis

Description

@AndreRicardo-Zoetis
  • Package Name:
  • azsdk-python-storage-blob
  • Package Version:
  • 12.25.0
  • Operating System:
  • Debian 12
  • Python Version:
  • Python/3.11.2

Describe the bug
A clear and concise description of what the bug is.

Upload hangs forever no response.

Apr 17 21:50:39 vetscan python3[1184618]: [INFO] azure.core.pipeline.policies.http_logging_policy - Request URL: 'https://qaazrvtscanstorps8f.blob.core.windows.net/dataingestionstorage/2361100WW1/syslog/Vetscan-OptiCell/2305016-776-VT/20240806/test_1MB.txt?timeout=REDACTED&sv=REDACTED&sr=REDACTED&sig=REDACTED&se=REDACTED&sp=REDACTED'
                                          Request method: 'PUT'
                                          Request headers:
                                              'Content-Length': '1048614'
                                              'x-ms-meta-typeId': 'REDACTED'
                                              'x-ms-blob-type': 'REDACTED'
                                              'x-ms-version': 'REDACTED'
                                              'Content-Type': 'application/octet-stream'
                                              'Accept': 'application/xml'
                                              'User-Agent': 'azsdk-python-storage-blob/12.25.0 Python/3.11.2 (Linux-6.1.0-31-amd64-x86_64-with-glibc2.36)'
                                              'x-ms-date': 'REDACTED'
                                              'x-ms-client-request-id': '7932dcac-3aa7-11f1-8192-003064738ffd'
                                          A body is sent with the request

To Reproduce
Steps to reproduce the behavior:

  1. Run an upload using upload_blob
with BlobClient.from_blob_url(sas_url) as blob_client:
            with open(file_name, "rb") as f:
                metadata = {}
                if typeId:
                    metadata["typeId"] = typeId
                size = os.path.getsize(file_name)
                logger.info(
                    f"Uploading file: {file_name} ({size} bytes) to Azure Storage."
                )

                result = blob_client.upload_blob(
                    f,
                    overwrite=True,
                    blob_type="BlockBlob",
                    max_single_put_size=1024 * 1024 * 4,  # 4MB chunks
                    max_block_size=1024 * 1024 * 8,  # 8 MiB
                    timeout=10,
                    retry_total=0,
                    metadata=metadata,
                    progress_hook=lambda uploaded, total: logger.info(
                        f"Upload progress: {uploaded}/{total} bytes ({(uploaded / total) * 100:.2f}%)"
                    ),
                )
                logger.info(
                    f"Upload completed for file: {file_name} with result: {result}"
                )

Expected behavior
A clear and concise description of what you expected to happen.

Expected a 201 response status like the one below

Apr 17 18:07:26 prod python3[1697020]: [INFO] azure.core.pipeline.policies.http_logging_policy - Response status: 201
                                       Response headers:
                                           'Content-Length': '0'
                                           'Content-MD5': 'REDACTED'
                                           'Last-Modified': 'Fri, 17 Apr 2026 18:07:26 GMT'
                                           'ETag': '"0x8DE9CAC2EE0E8FC"'
                                           'Server': 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0'
                                           'x-ms-request-id': '74eec86c-501e-006b-4a95-ce054b000000'
                                           'x-ms-client-request-id': '49e3d4c0-3a88-11f1-8e5e-0030647381cd'
                                           'x-ms-version': 'REDACTED'
                                           'x-ms-content-crc64': 'REDACTED'
                                           'x-ms-request-server-encrypted': 'REDACTED'
                                           'Date': 'Fri, 17 Apr 2026 18:07:26 GMT'

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Code was working fine until some weeks ago, no changes in our side. Neither on package version or this portion of the code.

The problem also happens with a simpler version of the code:

        with BlobClient.from_blob_url(sas_url) as blob_client:
            with open(file_name, "rb") as f:
                metadata = {}
                if typeId:
                    metadata["typeId"] = typeId

                result = blob_client.upload_blob(f, overwrite=True, metadata=metadata)

The problem also replicates in a different storage account:

Apr 17 22:18:47 vetscan python3[2191236]: [INFO] azure.core.pipeline.policies.http_logging_policy - Request URL: 'https://prodazrvtscanstordxlw.blob.core.windows.net/dataingestionstorage/23611011WA/syslog/Vetscan-OptiCell/2403098-1597-VT/20260304/040326_system.tar.gz?sv=REDACTED&sr=REDACTED&sig=REDACTED&se=REDACTED&sp=REDACTED'
                                          Request method: 'PUT'
                                          Request headers:
                                              'Content-Length': '35615028'
                                              'x-ms-meta-typeId': 'REDACTED'
                                              'x-ms-blob-type': 'REDACTED'
                                              'x-ms-version': 'REDACTED'
                                              'Content-Type': 'application/octet-stream'
                                              'Accept': 'application/xml'
                                              'User-Agent': 'azsdk-python-storage-blob/12.25.0 Python/3.11.2 (Linux-6.1.0-31-amd64-x86_64-with-glibc2.36)'
                                              'x-ms-date': 'REDACTED'
                                              'x-ms-client-request-id': '057b08f6-3aa3-11f1-a74c-0030647367f3'
                                          A body is sent with the request
Apr 17 22:19:47 vetscan python3[2191236]: [INFO] azure.core.pipeline.policies.http_logging_policy - Request URL: 'https://prodazrvtscanstordxlw.blob.core.windows.net/dataingestionstorage/23611011WA/syslog/Vetscan-OptiCell/2403098-1597-VT/20260304/040326_system.tar.gz?sv=REDACTED&sr=REDACTED&sig=REDACTED&se=REDACTED&sp=REDACTED'
                                          Request method: 'PUT'
                                          Request headers:
                                              'Content-Length': '35615028'
                                              'x-ms-meta-typeId': 'REDACTED'
                                              'x-ms-blob-type': 'REDACTED'
                                              'x-ms-version': 'REDACTED'
                                              'Content-Type': 'application/octet-stream'
                                              'Accept': 'application/xml'
                                              'User-Agent': 'azsdk-python-storage-blob/12.25.0 Python/3.11.2 (Linux-6.1.0-31-amd64-x86_64-with-glibc2.36)'
                                              'x-ms-date': 'REDACTED'
                                              'x-ms-client-request-id': '2932619a-3aa3-11f1-a74c-0030647367f3'
                                          A body is sent with the request

Strangely the issue seems to start if a file with the size of 35MB is sent, 35615028 bytes or near that.

Metadata

Metadata

Labels

Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions