azure-cli: `Failed precondition` when trying to batch delete blobs
Describe the bug When running:
az storage blob delete-batch \
--account-name "$AZURE_ACCOUNT_NAME" \
--account-key "$AZURE_ACCOUNT_KEY" \
--source "$CONTAINER" \
--if-unmodified-since "$DATE"
I get:
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
Failed precondition
[]
To Reproduce Run
az storage blob delete-batch \
--account-name "$AZURE_ACCOUNT_NAME" \
--account-key "$AZURE_ACCOUNT_KEY" \
--source "$CONTAINER" \
--if-unmodified-since "$DATE"
Expected behavior The blobs to be deleted.
Environment summary Installed in a virtualenv through pip.
Happens on both a CentOS TeamCity agent and locally on Cygwin.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (11 by maintainers)
Links to this issue
Commits related to this issue
- Implements manual blob deletion - Tries to get around this bug https://github.com/Azure/azure-cli/issues/6484 by manually deleting all the blobs one-by-one. — committed to ElvenSpellmaker/AzureOldBlobDelete by ElvenSpellmaker 6 years ago
- Implements manual blob deletion - Tries to get around this bug https://github.com/Azure/azure-cli/issues/6484 by manually deleting all the blobs one-by-one. — committed to ElvenSpellmaker/AzureOldBlobDelete by ElvenSpellmaker 6 years ago
- Implements manual blob deletion - Tries to get around this bug https://github.com/Azure/azure-cli/issues/6484 by manually deleting all the blobs one-by-one. — committed to ElvenSpellmaker/AzureOldBlobDelete by ElvenSpellmaker 6 years ago
- Implements manual blob deletion - Tries to get around this bug https://github.com/Azure/azure-cli/issues/6484 by manually deleting all the blobs one-by-one. — committed to ElvenSpellmaker/AzureOldBlobDelete by ElvenSpellmaker 6 years ago
- Implements manual blob deletion - Tries to get around this bug https://github.com/Azure/azure-cli/issues/6484 by manually deleting all the blobs one-by-one. — committed to ElvenSpellmaker/AzureOldBlobDelete by ElvenSpellmaker 6 years ago
- Implements manual blob deletion - Tries to get around this bug https://github.com/Azure/azure-cli/issues/6484 by manually deleting all the blobs one-by-one. — committed to ElvenSpellmaker/AzureOldBlobDelete by ElvenSpellmaker 6 years ago
- Implements manual blob deletion - Tries to get around this bug https://github.com/Azure/azure-cli/issues/6484 by manually deleting all the blobs one-by-one. — committed to ElvenSpellmaker/AzureOldBlobDelete by ElvenSpellmaker 6 years ago
@williexu I’ll see if I can find an account to try it on, but is that seriously the expected response format, an array of nulls if it’s deleted something, plus a load of
Failed precondition
to the terminal with no blob names or anything if it fails to meet the date?That output is so unusable for anything. 😂
@highbass I just successfully ran the following command:
Have you tried doing a
blob list
after to see if any of your blobs were deleted (it’s possible that some failed while others succeeded)?. In addition, if you can, try this on a smaller container, which you can populate with a smaller number of blobs and run the command with--debug
so we can see what is happening.I can’t reproduce a problem with the delete-batch command.
Such messages are printed to stderr so they will not interfere with any parsing. This command in particular is a CLI convenience command, not the result of a single API call, so we have full control over the output format (which is sounds like needs some work).
@ElvenSpellmaker can you raise a separate issue for the messages displayed? On that note,
Failed Precondition
messages do seem like unnecessary bloat, I may change that to ‘debug’ output or remove them entirely.