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

[Storage] --if-unmodified-since The condition specified using HTTP conditional header(s) is not met #5286

Closed
luisamador opened this issue Jan 12, 2018 · 7 comments · Fixed by #5702
Assignees
Labels
question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage az storage
Milestone

Comments

@luisamador
Copy link

luisamador commented Jan 12, 2018

I have a storage account with a storage container called "backups".

when the storage container is empty (no blob backup files in it) this command works:

az storage blob delete-batch --source backups --if-unmodified-since `date -d "1 month ago" '+%Y-%m-%dT%H:%MZ'`
[]

the command above deletes the files that were not modified since the last month, and it works as expected.

if I upload one blob backup file into the storage container and run the same command, it errors:

az storage blob delete-batch --source backups --if-unmodified-since `date -d "1 month ago" '+%Y-%m-%dT%H:%MZ'`
The condition specified using HTTP conditional header(s) is not met.
<?xml version="1.0" encoding="utf-8"?><Error><Code>ConditionNotMet</Code><Message>**The condition specified using HTTP conditional header(s) is not met.**
RequestId:ce18a9b3-001e-0117-78ab-8bea95000000
Time:2018-01-12T13:45:08.3718745Z</Message></Error>

Another example:

I have uploaded two blob files into the same storage container (now the storage container is not empty, it contains the two blob backup files)

az storage blob delete-batch --source backups --if-unmodified-since `date -d "2 minutes ago" '+%Y-%m-%dT%H:%MZ'`
The condition specified using HTTP conditional header(s) is not met.
<?xml version="1.0" encoding="utf-8"?><Error><Code>ConditionNotMet</Code><Message>**The condition specified using HTTP conditional header(s) is not met.**

It errors but it has actually deleted one of the backup files that I uploaded 4 minutes ago.

It would be great to fix that error message since the delete operation is actually working properly. Thanks

@tjprescott tjprescott added Storage az storage question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 12, 2018
@elibarzilay
Copy link
Contributor

Sidenote for random readers: you should use a -u flag for date to make it show UTC times. (I'm guessing that you happened to use a machine that is on UTC time anyway.)

@arbaiti
Copy link

arbaiti commented Mar 9, 2018

Hi luisamador,
Did you find a fix to this issue bacause i'm facing the same.
Regards,

@rupert-madden-abbott
Copy link

I've got this problem and can't tell from this ticket if this fix has been released yet.

What milestone did #5702 go into?

@williexu
Copy link
Contributor

williexu commented Mar 14, 2018

Milestone 33.
It was published yesterday on pypi, ver 2.0.29; sorry for the confusion.

@haroldrandom haroldrandom added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage az storage labels Oct 25, 2019
@its-vincesanity
Copy link

Now it's 2021, and I got the same Problem as described above. So it's not fixed or is the example "just" not working?

@Rub21
Copy link

Rub21 commented Feb 18, 2022

18-Feb-2022 , I got same error:

modified_since=$(date -d "-1 min" "+%Y-%m-%dT%H:%MZ")
az storage blob upload-batch \
				--destination $AZURE_CONTAINER_NAME/$REPLICATION_FOLDER \
				--source $workingDirectory \
				--if-modified-since $modified_since

@yonzhan yonzhan assigned evelyn-ys and unassigned williexu Feb 19, 2022
@yonzhan yonzhan added this to the Backlog milestone Feb 19, 2022
@justinmchase
Copy link

This is happening on the delete also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage az storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.