leeroybrun / glacier-vault-remove

Remove all archives stored inside an Amazon Glacier vault, even if you have a huge number of them.
379 stars 50 forks source link

UnexpectedHTTPResponseError #2

Closed codydh closed 11 years ago

codydh commented 11 years ago

I'm attempting to remove a Vault with 115 Archives in it. When I run the command, I'm getting an error (private info removed below):

codydh@dev:~/glacier-vault-remove# python ./removeVault.py us-east-1 vaultname
INFO : Connecting to Amazon Glacier...
INFO : Getting selected vault...
INFO : Getting jobs list...
INFO : Found existing inventory retrieval job...
INFO : Inventory retrieved, parsing data...
INFO : Removing archives... please be patient, this may take some time...
INFO : Removing vault...
Traceback (most recent call last):
  File "./removeVault.py", line 98, in <module>
    vault.delete()
  File "/usr/local/lib/python2.7/dist-packages/boto-2.15.0-py2.7.egg/boto/glacier/vault.py", line 71, in delete
    self.layer1.delete_vault(self.name)
  File "/usr/local/lib/python2.7/dist-packages/boto-2.15.0-py2.7.egg/boto/glacier/layer1.py", line 189, in delete_vault
    return self.make_request('DELETE', uri, ok_responses=(204,))
  File "/usr/local/lib/python2.7/dist-packages/boto-2.15.0-py2.7.egg/boto/glacier/layer1.py", line 84, in make_request
    raise UnexpectedHTTPResponseError(ok_responses, response)
boto.glacier.exceptions.UnexpectedHTTPResponseError: Expected 204, got (400, code=InvalidParameterValueException, message=Vault not empty or recently written to: arn:aws:glacier:us-east-1:449410151148:vaults/vaultname)
codydh@dev:~/glacier-vault-remove# 
leeroybrun commented 11 years ago

Can you please try again later and tell me if it worked this time ? Sometimes Glacier don't notice immediately you have removed all archives from the vault and send you a "Vault not empty or recently written to" error.

codydh commented 11 years ago

Yes, it worked again later. It'd be great if there were some error handling to let you know that the archives have been removed and that vault removal has to happen later.

leeroybrun commented 11 years ago

You're right, I added this to the TODO list.