Unable to update bucket policy
I've followed this document
All steps mentioned here work except when I try to update bucket policy. I'm able to upload files, delete files, list files .
I'm trying to update the policy for an bucket that I created from Linode dashboard and already has a policy defined.
s3cmd setpolicy policy.json s3://example-bucket
ERROR: S3 error: 403 (AccessDenied)
1 Reply
I recently addressed a similar issue in this Community Site Post.
To add to what I wrote there, I tried to recreate this for you. I created a new bucket in Chicago to see what the default Bucket Policy was. While there is a default ACL, there is no default Bucket Policy.
s3cmd info s3://defaultpolicytestbucket
s3://defaultpolicytestbucket/ (bucket):
Location: default
Payer: BucketOwner
Expiration Rule: none
Policy: none
CORS: <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><CORSRule><AllowedMethod>GET</AllowedMethod><AllowedMethod>PUT</AllowedMethod><AllowedMethod>DELETE</AllowedMethod><AllowedMethod>HEAD</AllowedMethod><AllowedMethod>POST</AllowedMethod><AllowedOrigin>*</AllowedOrigin><AllowedHeader>*</AllowedHeader></CORSRule></CORSConfiguration>
ACL: 645f5495-c8d1-4563-937d-5d78167069c2: FULL_CONTROL
I then tried to set a Bucket Policy using those instructions and I didn't receive an error:
s3cmd setpolicy policy.json s3://defaultpolicytestbucket
s3://defaultpolicytestbucket/: Policy updated
You can run s3cmd info s3://$bucketname
to see what the current policies are, but there shouldn't be anything stopping you by default.
You can also run the set policy command in debugging mode to see if that gets you more information:
s3cmd setpolicy policy.json s3://[MyBucketName] -d