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

Unable to use S3 Path Style Access S3 URL #3342

Closed
Edstub207 opened this issue Jun 11, 2024 · 3 comments
Closed

Unable to use S3 Path Style Access S3 URL #3342

Edstub207 opened this issue Jun 11, 2024 · 3 comments
Assignees
Labels
bug This issue is a bug. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. s3

Comments

@Edstub207
Copy link

Describe the bug

We are using Minio which has S3 Functionality, by default the URL is minio.blah.randomurl.com/bucketname/, however, when we provide that URL the AWS S3 SDK falls over, it looks like other libraries (Java for example) allow you to use this bucket formatting with things like withPathStyleAccessEnabled but I can't see that on the AWS .net API__

Expected Behavior

Able to use either bucketname.minio.blah.randomurl.com/ or minio.blah.randomurl.com/bucketname/ as a URL for S3 Storage with the AWS API

Current Behavior

1: Prefixes the bucket name into the ServiceURL which doesn't resolve DNS as it doesn't exist

2: No bucket name is provided and an exception is thrown because a bucketname is a required field

System.ArgumentException: BucketName is a required property and must be set before making this call. (Parameter 'GetObjectRequest.BucketName')
   at Amazon.S3.Model.Internal.MarshallTransformations.GetObjectRequestMarshaller.Marshall(GetObjectRequest getObjectRequest)
   at Amazon.Runtime.Internal.Marshaller.PreInvoke(IExecutionContext executionContext)
   at Amazon.Runtime.Internal.Marshaller.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.S3.Internal.AmazonS3ExceptionHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)

Reproduction Steps

Have the following confiig line for an AWS Store (Customized to your relevant Minio URL)
awsOptions.DefaultClientConfig.ServiceURL = "minio.blah.randomurl.com/bucketname/";

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

AWSSDK.S3 3.7.309.2

Targeted .NET Platform

Net 8

Operating System and version

Docker Container Built on Windows running on Linux

@Edstub207 Edstub207 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 11, 2024
@ashishdhingra ashishdhingra self-assigned this Jun 12, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Jun 12, 2024

@Edstub207 Good morning. Thanks for opening the issue. Are you able to use AmazonS3Config.ForcePathStyle property in AWS .NET SDK? Please confirm if it works for your use case.

Kindly note that we do not support using AWS .NET SDK with 3rd party AWS simulated services. SDK might work for certain scenarios, however, there are always some edge cases.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 12, 2024
@Edstub207
Copy link
Author

@ashishdhingra thanks for the reply, an ex-colleague pointed me towards some reference code which I missed when looking into this and that's solved my problem!

@Edstub207 Edstub207 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2024
Copy link

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.

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. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. s3
Projects
None yet
Development

No branches or pull requests

2 participants