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

Azure Storage Blob: delete_blobs returns warning when using list[dict] as argument #12778

Closed
dr-dolittle opened this issue Jul 29, 2020 · 3 comments
Assignees
Labels
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 question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@dr-dolittle
Copy link

dr-dolittle commented Jul 29, 2020

  • Package Name: azure.storage.blob
  • Package Version: 12.3.2
  • Operating System: Windows
  • Python Version: 3.8.1

I retrieve blobs matching a certain pattern and then delete them:

from azure.storage.blob import ContainerClient, BlobProperties
from azure.core.paging import ItemPaged
from typing import List

blob_paged: ItemPaged[BlobProperties] = container_client.list_blobs(name_starts_with=prefix)
blob_list: List[dict] = list(blob_paged)
number_of_blobs: int = len(blob_list)

if number_of_blobs > 0:
    container_client.delete_blobs(*blob_list, delete_snapshots="include")
    log.debug(f"Deleted '{ number_of_blobs }' blobs and snapshots...")   
else:
    log.debug(f"No blobs to be deleted...")

It works but it emits the following warning logs for each request made through the deletion process:

Failed to parse headers (url=https://xxx.blob.core.windows.net:443/?comp=batch): [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''
Traceback (most recent call last):
  File "xxx\__app__\.venv\lib\site-packages\urllib3\connectionpool.py", line 446, in _make_request
    assert_header_parsing(httplib_response.msg)
  File "xxx\__app__\.venv\lib\site-packages\urllib3\util\response.py", line 71, in assert_header_parsing
    raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
urllib3.exceptions.HeaderParsingError: [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''

Is this intended? If not, can you please fix that?

Thanks

@ghost ghost added needs-triage Workflow: 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 Jul 29, 2020
@lmazuel lmazuel added Client This issue points to a problem in the data-plane of the library. 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) labels Jul 29, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 29, 2020
@ghost
Copy link

ghost commented Jul 29, 2020

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

@xiafu-msft
Copy link
Contributor

Hi @dr-dolittle

Thanks for reporting this issue! the pr above should resolve the problem!

@dr-dolittle
Copy link
Author

@xiafu-msft Just tested it again. The warning is still displayed

Failed to parse headers (url=https://xxx.blob.core.windows.net:443/?comp=batch): [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''
Traceback (most recent call last):
  File "C:\xxx\__app__\.venv\lib\site-packages\urllib3\connectionpool.py", line 446, in _make_request
    assert_header_parsing(httplib_response.msg)
  File "C:\xxx\__app__\.venv\lib\site-packages\urllib3\util\response.py", line 71, in assert_header_parsing
    raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
urllib3.exceptions.HeaderParsingError: [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this issue Feb 4, 2021
00Kai0 added a commit that referenced this issue Feb 18, 2021
* CodeGen from PR 12778 in Azure/azure-rest-api-specs
update mixedreality readme.java.md (#12778)

* test,version,CHANGELOG

* fix test

Co-authored-by: SDKAuto <sdkautomation@microsoft.com>
@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
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 question The issue doesn't require a change to the product in order to be resolved. Most issues start as that 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

4 participants