Can't download from S3 Glacier using AWS CLI

1

I am trying to download the output of a Glacier job using the AWS CLI, but I'm encountering an error stating that the job ID was not found. Here are the steps I've taken:

  1. Executed the following command to describe the job: aws glacier describe-job --account-id - --vault-name Archive --job-id tPaHK26XsE1Gh9M<lots of chars deleted here for security>u0-8_altC2hHqcp8t3xkykp_ocn4hArGhQ_q

    The response shows the job details with a "Succeeded" status and a valid job ID.

  2. Attempted to download the job output using the following command: aws glacier get-job-output --vault-name Archive --account-id - --job-id tPaHK26XsE1Gh9M<lots of chars deleted here for security>u0-8_altC2hHqcp8t3xkykp_ocn4hArGhQ_q output.json

    However, this command returns an error stating "ResourceNotFoundException" and mentions that the job ID was not found.

I have confirmed that the vault name and account ID used in the commands are correct. I'm unsure why the job ID is not recognized when attempting to download the output. Any assistance in resolving this issue would be greatly appreciated. Thank you!

asked 10 months ago333 views
2 Answers
0

What is the status of the job?
The "description-job" response contains the word "Completed".
If this value is not true, "get-job-output" will result in an error.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glacier/describe-job.html

Incidentally, you can also check if the job is complete with the following command.
In the same way, "get-job-output" will fail unless "Completed" in the response is set to true.

aws glacier list-jobs --account-id ************ --vault-name Archive
profile picture
EXPERT
answered 10 months ago
  • Thanks for your answer. The StatusCode from a describe-job is "Succeeded". However it still doesn't recognise the job-id.

  • It is also necessary to check whether the job itself exists by executing the following command. Can you run this command to make sure the job is there?

    aws glacier list-jobs --account-id ************ --vault-name Archive
    

    As described in the following document, if more than 24 hours have passed since the job was issued, it must be re-created. https://docs.aws.amazon.com/amazonglacier/latest/dev/downloading-an-archive-two-steps.html

    S3 Glacier must complete a job before you can get its output. After completion, a job does not expire for at least 24 hours, which means that you can download the output within the 24-hour period after the job is completed. To determine if your job is complete, check its status by using one of the following options:

0

It seems that you're encountering an issue when attempting to download the output of a Glacier job using the AWS CLI. There might be a couple of reasons why you're receiving a "ResourceNotFoundException" error. Here are some troubleshooting steps you can follow:

  1. Double-check the Job ID: Ensure that the Job ID you're providing in the get-job-output command is correct. It should match the Job ID of the previously described job. It's possible that there may be a typo or a discrepancy in the ID you're using.

  2. Check Vault Name and Account ID: Verify that you're using the correct Vault Name and Account ID in the get-job-output command. Make sure they match the values associated with the Glacier job you're working with.

  3. Wait for Job Completion: Ensure that the Glacier job has completed successfully before attempting to download the output. It's possible that the job is still in progress, which could result in the "ResourceNotFoundException" error.

  4. Confirm Proper Permissions: Ensure that the AWS credentials you're using have the necessary permissions to access the Glacier service and perform the get-job-output action. Double-check the IAM policies attached to the credentials and ensure that they grant the required Glacier permissions.

  5. Retry after Some Time: Glacier operations may sometimes experience delays in propagating changes. If you've recently created or completed the job, it's worth waiting a few minutes and trying the get-job-output command again.

If the issue persists after following these steps, it's recommended to review the AWS CLI documentation for Glacier and consider reaching out to AWS Support for further assistance. They can help investigate the specific details of your Glacier job and provide guidance tailored to your situation.

profile picture
answered 10 months ago
  • Thanks for your kind answer. Unfortunately, I've checked and double checked all of the id's and names used in the commands. The Job id is actually copied and pasted in to ensure that it's identical. I'm operating from a Root user account, so permissions shouldn't even be an issue. It's been two days. The describe-job call returns a "Success" report. I've been trying all morning with the get-job-output command. I've scoured the documentation, and the web for any clues. It's reporting one job-id and then not accepting the same job-id to get the output. I may have to try AWS support as this just looks janky.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions