Skip to content

az storage blob delete-batch --if-modified-since produces lots of The condition specified using HTTP conditional header(s) is not met. errors. #22261

@justinmchase

Description

@justinmchase

Describe the bug

Many errors are unexpectedly produced when calling az storage blob delete-batch with the --if-unmodified-since flag.

ERROR: Client-Request-ID=b4fd2390-cb17-11ec-b930-0242ac110006 Retry policy did not allow for a retry: Server-Timestamp=Tue, 03 May 2022 19:32:01 GMT, Server-Request-ID=3c922cd2-901e-005a-7824-5f7387000000, HTTP status code=412, Exception=The condition specified using HTTP conditional header(s) is not met. ErrorCode: ConditionNotMetConditionNotMetThe condition specified using HTTP conditional header(s) is not met.RequestId:3c922cd2-901e-005a-7824-5f7387000000Time:2022-05-03T19:32:02.2897008Z.

To Reproduce

  1. Create a storage account
  2. Upload some files to the $web container
  3. Run the following command:
    az storage blob delete-batch \
      --account-name "$STORAGE_ACCOUNT_NAME" \
      --source '$web' \
      --if-unmodified-since $(date -d "1 day ago" '+%Y-%m-%dT%H:%MZ')

Expected behavior
All files older 1 day ago are deleted, all files younger than 1 day ago remain. No errors are produced.

Environment summary
pip / 2.29.2 / CentOS7 / bash

Additional context
It appears to be a regression of #5286

Metadata

Metadata

Labels

Auto-AssignAuto assign by botStorageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions