1

I am trying to restore the glacier deep archive to a different s3 bucket, but when I run the below command getting error : fatal error: An error occurred (404) when calling the HeadObject operation: Key "cf-ant-prod" does not exist

aws s3 cp s3://xxxxxxx/cf-ant-prod s3://xxxxxxx/atest --force-glacier-transfer --storage-class STANDARD --profile xxx

Maxim Masiutin
  • 3,991
  • 4
  • 55
  • 72
Arunkumar
  • 595
  • 1
  • 9
  • 23
  • Are you sure you have the right name for the object? Please note that it only works on a single object, not a folder. (To restore a folder, you would need to include `--recursive`. – John Rotenstein Sep 10 '20 at 23:16
  • Yes I am trying to restore a folder, aws s3 cp s3://xxxxxxx/cf-ant-prod s3://xxxxxxx/atest --force-glacier-transfer --recursive --storage-class STANDARD --profile xxx. Hope this is the command I need to use? – Arunkumar Sep 11 '20 at 07:13
  • 1
    I did some experimentation and found that the `--recursive` and `--force-glacier-transfer` had to be _before_ the filenames. However, I got the error: `Operation is not valid for the source object's storage class`. I know that Glacier retrievals normally take time, so I'm surprised that there is a "force-glacier-transfer" option. I suspect you will need to use `aws s3api restore-object` to move it (temporarily) out of the Glacier storage class so that it can be copied. – John Rotenstein Sep 11 '20 at 07:28
  • This StackOverflow answer suggests that it will only work on objects that have already been restored: [AWS S3 Sync --force-glacier-transfer - Stack Overflow](https://stackoverflow.com/questions/51676738/aws-s3-sync-force-glacier-transfer) – John Rotenstein Sep 11 '20 at 07:28
  • 1
    As suggest I am trying to use aws s3api, I do have aws MFA enabled so when I try to run the below command aws s3api list-objects-v2 --bucket MYBUCKET --query "Contents[?StorageClass=='GLACIER']" --output text | awk '{print substr($0, index($0, $2))}' | awk '{NF-=3};3' > glacier-restore.txt --profile xxx getting error : awk: fatal: cannot open file `--profile' for reading (No such file or directory) An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied – Arunkumar Sep 11 '20 at 07:57
  • That appears to be a different topic. Please create a new question. – John Rotenstein Sep 11 '20 at 08:01

0 Answers0