Skip to content
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

TransferUtility does not support downloading objects in Requester Pays buckets. #3301

Closed
krishsingh-git opened this issue Apr 25, 2024 · 10 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue queued s3

Comments

@krishsingh-git
Copy link

Describe the bug

TransferUtility does not support downloading objects in Requester Pays buckets.

await s3Client.DownloadToFilePathAsync(
s3Location.BucketName.Value, s3Location.Key.Value,
downloadPath.Path.Value, additionalProperties);

Expected Behavior

TransferUtility does not support downloading objects in Requester Pays buckets.
allow download ,, remove access denied error

Current Behavior

TransferUtility does not support downloading objects in Requester Pays buckets.

await s3Client.DownloadToFilePathAsync(
s3Location.BucketName.Value, s3Location.Key.Value,
downloadPath.Path.Value, additionalProperties);

Reproduction Steps

await s3Client.DownloadToFilePathAsync(
s3Location.BucketName.Value, s3Location.Key.Value,
downloadPath.Path.Value, additionalProperties);

Possible Solution

add requestpayer in transfer utility DownloadToFilePathAsync

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

AWSSDK.S3 3.7.9.17

Targeted .NET Platform

.net core 3.1

Operating System and version

window

@krishsingh-git krishsingh-git added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 25, 2024
@krishsingh-git
Copy link
Author

its high priority ?can anyone look into issue

@bhoradc bhoradc added s3 p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Apr 25, 2024
@bhoradc bhoradc self-assigned this Apr 25, 2024
@bhoradc
Copy link

bhoradc commented Apr 25, 2024

Hi @krishsingh-git,

Thank you for reporting the issue. If you came across the Access denied error, when downloading object from a Requester Pays bucket using TransferUtility, can you kindly provide below additional information?

  • Self-contained code sample that reproduces the Access Denied error.
  • Does the Source and destination buckets reside in cross-accounts?

Regards,
Chaitanya

@bhoradc bhoradc added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 25, 2024
@ashishdhingra ashishdhingra added the needs-reproduction This issue needs reproduction. label Apr 25, 2024
@krishsingh-git
Copy link
Author

krishsingh-git commented Apr 25, 2024 via email

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 26, 2024
@krishsingh-git
Copy link
Author

please make it P1,, in our organisation ,, its burning issue

@krishsingh-git
Copy link
Author

please arrange a call i will explain

@bhoradc
Copy link

bhoradc commented Apr 27, 2024

Hi @krishsingh-git,

I am able to reproduce the Access Denied AmazonS3Exception when downloading objects using the Transfer utility with Requester Pays enabled.

Below are the steps and the code sample I used with the latest .NET SDK/Package version for reproduction.

  • Enabled Requester pays option from the console for the bucket in account A.
  • Configured the necessary bucket policies for s3:GetObject for the IAM role from account B.
  • Using below snippet, I am getting the S3 access exception when downloading the object (account A) from account B.
using Amazon.S3;
using Amazon.S3.Transfer;
using System;
using System.Threading.Tasks;

namespace ReqPaysIssue_3301
{
    class Program
    {
        static async Task Main(string[] args)
        {
            try
            {
                IAmazonS3 s3Client = new AmazonS3Client();
                var transferUtil = new TransferUtility(s3Client);
                await transferUtil.DownloadAsync(new TransferUtilityDownloadRequest
                {
                    BucketName = <<bucket_name>>,
                    Key = <<key>>,
                    FilePath = <<file_path>>,
                });
            }
            catch (Exception ex)
            {
                await Console.Out.WriteLineAsync(ex.Message);
                throw;
            } 
        }     
    }    
}

Reproduced output:

Access Denied Unhandled exception. Amazon.S3.AmazonS3Exception: Access Denied ---> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.

Kindly let me know if above reproduction is unclear or if you have any other observations.

I will review this issue with the SDK team and keep you posted on the updates.

Regards,
Chaitanya

@bhoradc bhoradc added p1 This is a high priority issue needs-review and removed needs-reproduction This issue needs reproduction. p2 This is a standard priority issue labels Apr 27, 2024
@krishsingh-git
Copy link
Author

krishsingh-git commented Apr 27, 2024 via email

@ashishdhingra ashishdhingra added p2 This is a standard priority issue and removed p1 This is a high priority issue labels Apr 29, 2024
@bhoradc bhoradc added the queued label Apr 30, 2024
@ashishdhingra
Copy link
Contributor

@krishsingh-git RequestPayer property should be available in AWSSDK.S3 version 3.7.307.27 (refer Chengelog)

Copy link

github-actions bot commented May 2, 2024

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@krishsingh-git
Copy link
Author

krishsingh-git commented May 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue queued s3
Projects
None yet
Development

No branches or pull requests

3 participants