Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS S3 CLI: Anonymous users cannot initiate multipart uploads

I'm trying to upload a file to Amazon S3 via the command-line, but I keep receiving this error:

A client error (AccessDenied) occurred when calling the CreateMultipartUpload operation: Anonymous users cannot initiate multipart uploads. Please authenticate.

The command I'm running is:

# aws s3 cp --sse pad-20151108-175046.tar.gz s3://mpen-backups

I've configured aws via aws configure with what I believe are the correct credentials. aws s3 ls does list my buckets.

How do I provide a user to AWS CLI? My googlefu isn't turning up anything useful.


I installed aws via apt-get install awscli (on Ubuntu).

# aws --version
aws-cli/1.2.9 Python/3.4.0 Linux/3.13.0-24-generic
like image 816
mpen Avatar asked Nov 08 '15 23:11

mpen


3 Answers

Solution: take your dog(s) out for a walk.

I just came back after about 30 minutes, pressed up on my terminal and re-ran the exact same command. Uploaded fine this time.

I think either Amazon was having authentication issues when I first ran this, or maybe my S3 bucket hadn't propagated yet, but it runs fine now.

like image 183
mpen Avatar answered Oct 22 '22 10:10

mpen


I couldnt upload even when i tried IAM Role, config file and ENV Variables.

In my case it was a Repo installed AWSCLI, specifically on Debian 8.6:

awscli/stable,now 1.4.2-1 all [installed]

Removed it and installed with pip as recommended by AWS Docs

Works now.

like image 20
Saad Masood Avatar answered Oct 22 '22 11:10

Saad Masood


In my case this message was displayed because the user trying to copy the file to s3 doesn't have permission to. To fix it was adding user write permission to the s3 bucket.

like image 29
dirceusemighini Avatar answered Oct 22 '22 11:10

dirceusemighini