AWS S3 CLI error while trying to copy files locally using terminal

0 votes

I am trying to copy files locally from S3 Bucket using command :  aws s3 ls s3://myBucket/myDirectory/todaysFiles/

And i am getting a error

fatal error: An error occurred (404) when calling the HeadObject operation: Key "myDirectory/todaysFiles/" does not exist

If i try to copy individual file using command : 

 aws s3 cp s3://myBucket/myDirectory/todaysFiles/somefile 

i am getting an error

warning: Skipping file s3://myBucket/myDirectory/todaysFiles/somefile. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to the perform operation. See aws s3 download help for additional parameter options to ignore or force these transfers.

And i have know idea as to why these errors are occurring. Any help would be appreciated.

Aug 3, 2018 in AWS by datageek
• 2,540 points
11,391 views

1 answer to this question.

0 votes

For the first error you should add the recursive flag:

aws s3 cp s3://myBucket/myDirectory/todaysFiles/ . --recursive

This will copy all the files in the "todaysFiles" directory to the current directory.

But, the second error indicates that your files are in Glacier. This might complicate things as Glacier is not real time - depending on what you're willing to pay it can be hours before the data is restored. You can't copy from S3 until the object are restored from Glacier to S3. You can even check out the details of Migrating to AWS with the AWS Cloud Migration Certification.

Note that if you do this you will have costs from both Glacier and S3.

answered Aug 3, 2018 by Archana
• 4,170 points

Related Questions In AWS

0 votes
1 answer
+1 vote
3 answers

How to get ARN for s3 Bucket using aws cli .

An ARN is a non-opaque, constructible identifier, ...READ MORE

answered Aug 16, 2018 in AWS by Priyaj
• 58,020 points
5,637 views
0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,170 points
19,847 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,024 views
+1 vote
2 answers

AWS CloudWatch Logs in Docker

The awslogs works without using ECS. you need to configure ...READ MORE

answered Sep 7, 2018 in AWS by bug_seeker
• 15,510 points
2,028 views
0 votes
1 answer

Error : [SSL : CERTIFICATION_VERIFY_FAILED] while trying to connect to S3

Probably your bucket name contains a dot, ...READ MORE

answered Aug 6, 2018 in AWS by Archana
• 4,170 points
4,160 views
0 votes
2 answers

How to display just the name of files using aws s3 ls command?

aws s3 ls s3://<your_bucket_name>/ | awk '{print ...READ MORE

answered Mar 17, 2019 in AWS by anonymous
22,192 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP