Ste
Ste

Reputation: 685

AWS S3 CLI:An error occurred (AllAccessDisabled) when calling the PutObject operation: All access to this object has been disabled

I'm using aws-cli/1.15.25 Python/2.7.15 Darwin/17.7.0 botocore/1.10.25 to try and upload a file to S3 using the following command:

aws s3 cp <file> s3://bucket.s3.amazonaws.com/<bucket name>

But I get the following returned:

u

pload failed: ./<file> to s3://bucket.s3.amazonaws.com/<bucket name> An error occurred (AllAccessDisabled) when calling the PutObject operation: All access to this object has been disabled

I have, as a test, set my bucket to accessible by all with the following policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Principal": "*",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:PutObjectAcl",
                "s3:GetObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::<bucket name>/*"
            ]
        }
    ]
}

My IAM user has the correct permissions set

I don't know what else to look at. I've Googled and tried most suggestions

Upvotes: 7

Views: 19459

Answers (2)

ddrypczewski
ddrypczewski

Reputation: 131

Note: AllAccessDisabled error will be displayed when non existing folder path is specified (misspelling) .

Upvotes: 13

John Hanley
John Hanley

Reputation: 81464

You are specifying the bucket name twice in the URL or you are actually using the string "bucket".

Your can use the virtual hosted style as:

http://bucketname.s3.amazonaws.com/path/to/file

http://bucketname.s3-aws-region.amazonaws.com/path/to/file

or the path style URL:

http://s3.amazonaws.com/bucketnamepath/to/file

http://s3-aws-region.amazonaws.com/bucketname/path/to/file

Replace "aws-region" with the region. Use the "s3-aws-region" style for regions that are not us-east-1. Examples for a bucket in South America:

http://bucketname.s3-sa-east-1.amazonaws.com/path/to/file

http://s3-sa-east-1.amazonaws.com/bucketname/path/to/file

Upvotes: 6

Related Questions