-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-cpp-sdk Issue GetBucketLocation returns Access Denied - when not called by bucket owner #844
Comments
These are the Actions allowed on the bucket |
I also would add I can access buckets in us-east-1 without any issues. I get intermittent failures on both us-west (oregon) and eu-west (ireland) |
Have you tried this? Add the following policy to the bucket:
It works for me, but I am not sure if we are in the exact same scenario. |
The documentation states that only bucket owners are allowed to make this call.
https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html |
Hi The issue I have is we stream directly from S3 and we cannot stream from buckets in different regions without getting the bucket location and setting it in the Aws::Client::ClientConfiguration structure. For e.g. if my bucket is in US-WEST-2 but I started my instance in us-east-1 I have no recourse to get the bucket location. Sounds like the only way around is to use pre signed url's or make the bucket owner the same as the instance owner. |
Hi wps132230 Yes I have a similar policy on my bucket.
|
Yeah it's a service limitation. |
Thanks Marco for the response - we are going to use the presigned URL's for now. One suggestion I have seen at other places is to use head bucket. In the C++ sdk head bucket seems to return nothing if it is successful. Looking through the code it looks like some of the information exists in the XmlOutcome but is cleared out before we return. HeadBucketOutcome S3Client::HeadBucket(const HeadBucketRequest& request) const Looks like it is HeadBucketOutcome is cleared - can this still return the metadata from the bucket. I can then parse it out for the location and avoid using GetBucketLocation. Thanks -- |
Just for reference this is the post I found aws/aws-sdk-go#720
|
Unfortunately we don't have the values of the HTTP headers exposed. But I can see how that can be useful in such cases. I'll add an item to our backlog. |
Hi Thanks very much for adding this to your backlog. It is indeed a very useful feature. -- |
We are running on Centos and Ubuntu and seen the issue on both the systems.
GCC version 4.9.3
Here is the scenario - The data that we want to process in our application is available on S3 buckets. The customers control these S3 buckets. The buckets can be in any region (typically they are is us-east-1, us-west-2 and eu-west-2). We try to stream the data from S3 directly to ensure this works from any location we try GetBucketLocation - the issue is GetBucketLocation returns Access Denied if the client running the instance is not the owner of the bucket.
Not sure how to get around this limitation
Thanks
Jimmy
The text was updated successfully, but these errors were encountered: