I'm working on an Amazon s3 Compatible Object Storage solution (Minio).
I have an Minio server on e.g 192.168.235.143:9000
I have tried to get List of buckets on C# version of Amazon s3 Api. Everything works fine.
When I try to Put a Bucket into this server e.g test1, Visual studio throws this request into an Exception:
Amazon.Runtime.AmazonServiceException:
'A WebException with status NameResolutionFailure was thrown.'
WebException: The remote name could not be resolved: 'test1.192.168.235.143'
here is my code:
AmazonS3Config config = new AmazonS3Config();
config.ServiceURL = "192.168.235.143:9000";
AmazonS3Client client = new AmazonS3Client(AccessKey, SecretKey, config);
PutBucketRequest request = new PutBucketRequest();
request.BucketName = "test1";
// this Line will throws above exception :
client.PutBucket(request);
but ListBuckets works for make me confused:
AmazonS3Client client = new AmazonS3Client(AccessKey, SecretKey, config);
var response = client.ListBuckets();
foreach (S3Bucket b in response.Buckets)
{
MessageBox.Show(string.Format("{0}t{1}", b.BucketName, b.CreationDate));
}
What i have tested to check this Exception's cause:
I have Installed it on a Virtual machine and a local Version for doubly check this issue but it still persists.
I Even Changed Minio port to the port #80
I Even used "play.min.io" but has no difference
I need to use a known interface so we be able to port into another Object Storage Platform e.g Ceph, ....
I have no Idea to get it resolved yet.
Please Help me to find my mistake or a better solution
@Reza-Noei I understand you're using AWS SDK .Net, for that to work with MinIO (in this current setup) you need to enable PathStyle. Here is a sample: https://github.com/minio/cookbook/blob/master/docs/aws-sdk-for-dotnet-with-minio.md
@Reza-Noei Closing this issue based on the above comment. Please feel free to reach out to us at https://slack.min.io for further such questions
Thanks alot, it worked for me.
I have tried to close this issue some hours ago but i couldn't
Most helpful comment
@Reza-Noei I understand you're using AWS SDK .Net, for that to work with MinIO (in this current setup) you need to enable PathStyle. Here is a sample: https://github.com/minio/cookbook/blob/master/docs/aws-sdk-for-dotnet-with-minio.md