Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 cp fails with (AccessDenied) when calling the GetObjectTagging operation

When I try to copy data from public bucket into my own it fails with below error

aws s3 cp s3://awssampledbuswest2/tickit/spectrum/sales/sales_ts.000 s3://<my bkt>/

copy failed: s3://awssampledbuswest2/tickit/spectrum/sales/sales_ts.000 to s3://<my bkt>/sales_ts.000 An error occurred (AccessDenied) when calling the GetObjectTagging operation: Access Denied

Since source path is available to everyone then anyone can try to do the same by replacing <my bkt> with your own.

Surprisingly, I can download file from public bucket into local file system and upload it into my own bucket

aws s3 cp s3://awssampledbuswest2/tickit/spectrum/sales/ . --recursive

and

aws s3 cp sales_ts.000 s3://<my bkt>/

Any explanation why it occurs and how to avoid this error is highly appreciated!

PS. I tried with AWS account owner and with below IAM user but no luck. enter image description here

like image 815
Slimboy Fat Avatar asked Dec 01 '25 03:12

Slimboy Fat


1 Answers

A simpler solution is to use --copy-props none while copying

Example: aws s3 cp s3://source/object-name s3://destination/object-name/ --copy-props none --recursive

like image 152
viru Avatar answered Dec 02 '25 19:12

viru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!