S3 unhelpful error "Access Denied" when using ACL: 'public-read'
See original GitHub issue- [ x] I’ve gone though Developer Guide and API reference
- [ x] I’ve checked AWS Forums and StackOverflow for answers
- [ x] I’ve searched for previous similar issues and didn’t find any solution
Describe the bug
Setting ACL: 'public-read'
when the bucket has “Block” permissions gives unhelpful error of “Access Denied”.
Is the issue in the browser/Node.js? Node.js
If on Node.js, are you running this on AWS Lambda? No.
To Reproduce (observed behavior) Set the bucket permissions so it has “Block All”
var uploadParams = {Bucket: 'example-bucket', Key: '/test', Body: '', ACL: 'public-read'};
var putObjectPromise = await s3.upload(uploadParams).promise();
Expected behavior The error message should provide a more helpful / relevant message such as “Invalid Parameters” or “Incompatible Parameters”.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Ruby S3 "Access Denied" error when calling upload_file with ...
This seems to work fine, except that the file isn't publicly available, and I can't get a public URL for it. But when...
Read more >Resolve Access Denied errors from a CloudFront distribution ...
To troubleshoot Access Denied errors, first determine if your distribution's origin domain name is an S3 website endpoint or an S3 REST API ......
Read more >Troubleshoot IAM-related Access Denied errors in Amazon S3
An AWS Identity and Access Management (IAM) user has permission to the s3:PutObject action on my Amazon Simple Storage Service (Amazon S3) bucket....
Read more >Getting access denied error in s3 bucket policy even ... - Reddit
So someone with admin access, or even S3 read only, ... CloudFront is the answer there, or turn off the ACL that blocks...
Read more >Sets the permissions on an existing bucket using access ...
If your bucket uses the bucket owner enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. You must...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Specifically, “ACL is not compatible with the buckets policy” would have helped me for this specific situation.
If the “Access Denied” error is thrown for any invalid params, then wouldn’t “Param Conflict” still be relevant as it would only be thrown when a param has a conflict with the bucket?
I haven’t looked specifically for where it’s throwing the error message so I’m not sure on it’s context.
Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.