Skip to content

How to delete a Glacier Vault that is not empty?

0

I have been struggling for about 3 weeks trying to delete some Glacier vaults that I no longer need and being charged for it... so I though OK just click delete. But heck, no the vault must be empty! And it is impossible to empty it! Why? Because the vault contains thousands of jobs! Actually, it's so big that the CLI it a timeout... changed timeout to 120 to no avail. Use --debug and can see the issue is

Connect timeout on endpoint URL: "https://glacier.us-east-1.amazonaws.com/998818xxxxxx/vaults/DiskStationAlex_00113233C1FF_1"

So, is there any other way to delete a vault? Any third-party tool? Any scripts easy to download and run? (I am not a developer/programmer/coder)

If I can't find a solution my next course of action will be to delete my AWS account? That sounds stupid...

screenshot

asked 9 months ago408 views
4 Answers
1

To delete all archives in an AWS Glacier vault using the AWS CLI, follow these steps in a linux shell

  1. Initiate an Inventory Retrieval Job
aws glacier initiate-job --account-id - --vault-name YOUR_VAULT_NAME --job-parameters '{"Type": "inventory-retrieval"}'
  • Replace YOUR_VAULT_NAME with your actual vault name.
  • The --account-id - uses the default account.
  • This job can take several hours (up to 24 hours) to complete.
  1. Get the Job Output After the job is completed, get the job ID from the list of jobs:
aws glacier list-jobs --account-id - --vault-name YOUR_VAULT_NAME

Look for a completed inventory-retrieval job and note its JobId. Once completed, download the inventory:

aws glacier get-job-output --account-id - --vault-name YOUR_VAULT_NAME --job-id YOUR_JOB_ID output.json
  1. Extract Archive IDs The output.json file will contain a list of archives. Extract archive IDs using jq (a JSON processor):
cat output.json | jq -r '.ArchiveList[].ArchiveId' > archive-ids.txt
  1. Delete Archives Loop through the archive IDs and delete them one by one:
while read archive_id; do
    aws glacier delete-archive --account-id - --vault-name YOUR_VAULT_NAME --archive-id "$archive_id"
done < archive-ids.txt

You can of course put this into a shell script and perform all actions in 1 go

EXPERT
answered 9 months ago
0

Thanks, I have a timeout:

alex@dsa2:~$ aws glacier initiate-job --account-id 998818------ --vault-name DiskStationAlex_00113233C1FF_1 --job-parameters '{"Type": "inventory-retrieval"}'

Connect timeout on endpoint URL: "https://glacier.us-east-1.amazonaws.com/998818-----/vaults/DiskStationAlex_00113233C1FF_1/jobs"
answered 9 months ago
  • Your on a Synology NAS? You need to run the command from a machine with access to the endpoint along with IAM access keys.

    You may be best running from a cloudshell command in your AWS account.

0

To be more specific :

aws glacier describe-vault --account-id 998818------ --region us-east-1 --endpoint-url https://glacier.us-east-1.amazonaws.com --vault-name "DiskStationAlex_00113233C1FF_1"

Connect timeout on endpoint URL: "https://glacier.us-east-1.amazonaws.com/998818------/vaults/DiskStationAlex_00113233C1FF_1"

According to GUI this vault has 298,244 archives and is 559.2 GB

I just want to delete it, I can't think how I am going to delete 298,244 archives one by one using the CLI, it does not make any sense at all...

answered 9 months ago
0

OK I decided to ditch the docker aws-cli on my Synology as I suspected that something was wrong with it and leading to the timouts (network issue?)

I installed AWS CLI on Mac and I immediately got results:

Out of 6 Vaults on my AWS account 1 has a Job ID and 5 have no job IDs.

For the one that has a job ID when I run aws glacier list-jobs --account-id 9988------- --vault-name DiskStation---------233C1FF_1 I get this:

{ "JobId": "abcdefabcdefabcdef", "Action": "InventoryRetrieval", "VaultARN": "arn:aws:glacier:us-east-1:123456123456:vaults/DiskStation_1", "CreationDate": "2025-01-30T03:56:47.618Z", "Completed": false, "StatusCode": "InProgress", "InventoryRetrievalParameters": { "Format": "JSON" }

However when I run aws glacier get-job-output --account-id 998818--- --vault-name DiskStation------233C1FF_1 --job-id abcdefabcdefabcdef output.json

I get

An error occurred (InvalidParameterValueException) when calling the GetJobOutput operation: The job is not currently available for download: abcdefabcdefabcdef

answered 9 months ago