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

A vault is still there after removing of all its archives #37

Closed yzalvov closed 6 years ago

yzalvov commented 6 years ago

Hi Leeroy. Thanks for the project, really helpful. Please advise, the vault is still there after a couple hours after the script successfully removed all the archives. Many thanks for considering my request.

yzalvov commented 6 years ago

For example, the end of one of the vault logs look like:

... ... 22:12:18 - INFO : 13052 Remove archive number 12280 of 12281, ID : R22sFKUk36Ev5u9mp9_7MWJktO0U50q0374W3G3VXYZiCEydfJ9vKPvOWDWEYxfsuPY9WHk2683-yuNaLLOZkxNo9nk1zs26m8LflPWahMyi2UJT 22:12:18 - INFO : Removing vault... 22:12:18 - INFO : Resetting dropped connection: glacier.us-east-1.amazonaws.com 22:12:19 - ERROR : Exception "InvalidParameterValueException" occured with message "An error occurred (InvalidParameterValueException) when calling the DeleteVault operation: Vault not empty or recently written to: arn:aws:glacier:us-east-1:622041511:vaults/arq_38535B99-1D11-42A8-9FD9-407B" 22:12:19 - ERROR : We cant remove the vault now. Please wait some time and try again. You can also remove it from the AWS console, now that all archives have been removed.

yzalvov commented 6 years ago

Finally after a night after the second attempt the vault appeared to be empty and allowed to be deleted via AWS management console. Thank you!

leeroybrun commented 6 years ago

Yes, Amazon takes some time to detect the vault as empty. Unfortunately there's nothing we can do except waiting (as indicated in the last line of your logs).

I'm glad it finally worked!

sirvine commented 4 years ago

@leeroybrun Thank you for this library, which is one of the only sane ways I found to remove vaults.

The behavior described in this issue confused me until I found this thread, so I'll add some comments here for anyone who might have similar experiences later.

Based on the error message, I thought that I should be able to delete from the console immediately. In fact, you can't remove a vault via the AWS console until the inventory updates have propagated on the Amazon side, which takes something like 24 hours. You will know when Amazon is ready to delete the vault because the vault will show up as empty (with -- for size and number of archives) on the AWS console. Re-running removeVault.py (which I tried too many times) doesn't help.

Since this is likely to happen every time someone runs removeVault.py, perhaps this information belongs in the README?