question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MakeBucketAsync does not work with region parameter

See original GitHub issue

I am unable to create a bucket using the .NET client SDK. I get an exception with

MinIO API responded with message=The XML you provided was not well-formed or did not validate against our published schema

All my code does is

      _mc = new MinioClient(endpoint, config.AccessKeyId, config.SecretAccessKey);

      if (uri.Scheme == "https") {
        _mc = _mc.WithSSL();
      }

      _mc.MakeBucketAsync("xyz", _config.Region).Wait();

If I run a local minio server I get the following:

$ minio server minio-lol
...
API: PutBucket(bucket=xyz)
Time: 16:27:01 CEST 09/29/2020
DeploymentID: 4c442570-afbb-4ca2-a840-eb537e128865
RequestID: 1639476057D9FF78
RemoteHost: 127.0.0.1
Host: 127.0.0.1:9000
UserAgent: MinIO (Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64;X64) minio-dotnet/1.0.9
Error: Bad sha256: Expected e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 does not match calculated 21a2331ffea5b7711cd8a996461c34140a170b981d282a9e1ae9c5d38f672e50
       4: cmd/auth-handler.go:320:cmd.checkRequestAuthTypeToAccessKey()
       3: cmd/auth-handler.go:273:cmd.checkRequestAuthType()
       2: cmd/bucket-handlers.go:540:cmd.objectAPIHandlers.PutBucketHandler()
       1: net/http/server.go:2042:http.HandlerFunc.ServeHTTP()

And if I use admin tracing, I find this:

minio.cloud.algoryx.se [REQUEST s3.PutBucket] 14:44:51.385
minio.cloud.algoryx.se PUT /xyz
minio.cloud.algoryx.se Proto:
minio.cloud.algoryx.se Host: minio.cloud.algoryx.se:443
minio.cloud.algoryx.se Authorization: AWS4-HMAC-SHA256 Credential=xxx, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=xxx
minio.cloud.algoryx.se Content-Type: application/xml
minio.cloud.algoryx.se User-Agent: MinIO (Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64;X64) minio-dotnet/1.0.9
minio.cloud.algoryx.se X-Forwarded-Proto: https
minio.cloud.algoryx.se X-Real-Ip: 10.255.0.2
minio.cloud.algoryx.se Content-Length: 211
minio.cloud.algoryx.se X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
minio.cloud.algoryx.se X-Amz-Date: 20200929T144450Z
minio.cloud.algoryx.se X-Forwarded-For: 10.255.0.2
minio.cloud.algoryx.se X-Forwarded-Port: 443
minio.cloud.algoryx.se Accept: application/json, text/json, text/x-json, text/javascript, application/xml, text/xml
minio.cloud.algoryx.se Accept-Encoding: gzip, deflate
minio.cloud.algoryx.se Request-Id: |72590bfd-44bab348368790e7.1.
minio.cloud.algoryx.se X-Forwarded-Host: minio.cloud.algoryx.se:443
minio.cloud.algoryx.se X-Forwarded-Server: d655ef62def1
minio.cloud.algoryx.se <?xml version="1.0" encoding="utf-8"?>
<q1:CreateBucketConfiguration xmlns:q1="http://s3.amazonaws.com/doc/2006-03-01/">
  <q1:LocationConstraint>eu-west-1</q1:LocationConstraint>
</q1:CreateBucketConfiguration>
minio.cloud.algoryx.se [RESPONSE] [14:44:51.385] [ Duration 349µs  ↑ 432 B  ↓ 592 B ]
minio.cloud.algoryx.se 400 Bad Request
minio.cloud.algoryx.se Content-Security-Policy: block-all-mixed-content
minio.cloud.algoryx.se Content-Type: application/xml
minio.cloud.algoryx.se Server: MinIO/RELEASE.2020-06-22T03-12-50Z
minio.cloud.algoryx.se Vary: Origin
minio.cloud.algoryx.se X-Amz-Request-Id: 163948596A994443
minio.cloud.algoryx.se X-Xss-Protection: 1; mode=block
minio.cloud.algoryx.se Accept-Ranges: bytes
minio.cloud.algoryx.se Content-Length: 333
minio.cloud.algoryx.se <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>MalformedXML</Code><Message>The XML you provided was not well-formed or did not validate against our published schema.</Message><BucketName>xyz</BucketName><Resource>/xyz</Resource><RequestId>163948596A994443</RequestId><HostId>b85b8107-7224-464a-b477-f22bd6680c7a</HostId></Error>
minio.cloud.algoryx.se

If I compare this to my working python client:

minio.cloud.algoryx.se [REQUEST s3.PutBucket] 14:45:42.532
minio.cloud.algoryx.se PUT /e21dbb95-7a38-480a-9a58-dadc61e17db1/
minio.cloud.algoryx.se Proto:
minio.cloud.algoryx.se Host: minio.cloud.algoryx.se
minio.cloud.algoryx.se X-Amz-Date: 20200929T144542Z
minio.cloud.algoryx.se X-Forwarded-For: 10.255.0.2
minio.cloud.algoryx.se X-Real-Ip: 10.255.0.2
minio.cloud.algoryx.se X-Amz-Content-Sha256: UNSIGNED-PAYLOAD
minio.cloud.algoryx.se Content-Length: 153
minio.cloud.algoryx.se X-Forwarded-Proto: https
minio.cloud.algoryx.se X-Forwarded-Server: d655ef62def1
minio.cloud.algoryx.se Accept-Encoding: identity
minio.cloud.algoryx.se X-Forwarded-Port: 443
minio.cloud.algoryx.se Content-Md5: RRbNtostJSb8PTpMdgsvng==
minio.cloud.algoryx.se User-Agent: MinIO (Darwin; x86_64) minio-py/5.0.8
minio.cloud.algoryx.se X-Forwarded-Host: minio.cloud.algoryx.se
minio.cloud.algoryx.se Authorization: AWS4-HMAC-SHA256 Credential=xxx, SignedHeaders=content-length;content-md5;host;user-agent;x-amz-content-sha256;x-amz-date, Signature=xxx
minio.cloud.algoryx.se <CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><LocationConstraint>eu-west-1</LocationConstraint></CreateBucketConfiguration>
minio.cloud.algoryx.se [RESPONSE] [14:45:42.532] [ Duration 947µs  ↑ 355 B  ↓ 266 B ]
minio.cloud.algoryx.se 200 OK
minio.cloud.algoryx.se Content-Security-Policy: block-all-mixed-content
minio.cloud.algoryx.se Location: /e21dbb95-7a38-480a-9a58-dadc61e17db1
minio.cloud.algoryx.se Server: MinIO/RELEASE.2020-06-22T03-12-50Z
minio.cloud.algoryx.se Vary: Origin
minio.cloud.algoryx.se X-Amz-Request-Id: 1639486553292357
minio.cloud.algoryx.se X-Xss-Protection: 1; mode=block
minio.cloud.algoryx.se Accept-Ranges: bytes
minio.cloud.algoryx.se Content-Length: 0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ebozdumancommented, Dec 15, 2021

Thank you for checking @realZhangChi So, if it works on the master branch, then as soon as the new release comes out, we can close this issue. Although there is no specific release date at this point, we are currently and actively working on it.

0reactions
harshavardhanacommented, Mar 14, 2022

Please upgrade to the latest release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MakeBucketAsync does not work with region parameter
I am unable to create a bucket using the .NET client SDK. I get an exception with MinIO API responded with message=The XML...
Read more >
.NET Client API Reference — MinIO Object Storage for Linux
Creates MinIO client object with given endpoint.AccessKey, secretKey, region and sessionToken are optional parameters, and can be omitted for anonymous access.
Read more >
How to use the minio.Client function in minio
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... makeBucketAsync(bucket, region)) } if (blockStorage...
Read more >
c# - Having problems accessing bucket that is not using US ...
With the new AWS SDK for .Net (version 2 and above) it seems the region parameter is required and in fact the AmazonS3Client...
Read more >
Configure the AWS Region - AWS SDK for .NET
You can create an AWS service client that goes to a particular Region. ... This technique works even if the Region endpoint doesn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found