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

NullReferenceException If WithSSL(...) is omitted #1008

Open
warappa opened this issue Feb 15, 2024 · 1 comment
Open

NullReferenceException If WithSSL(...) is omitted #1008

warappa opened this issue Feb 15, 2024 · 1 comment

Comments

@warappa
Copy link

warappa commented Feb 15, 2024

If one doesn't call WithSSL(...), then a NullReferenceException is triggered inside the MinIO library.

Steps To Reproduce

Given this code:

var services = new ServiceCollection();
services.AddMinio(client =>
{
    client
        .WithCredentials("minioadmin", "minioadmin")
        .WithEndpoint("127.0.0.1", 9000)
        //.WithSSL(false)
       ;
});

var serviceProvider = services.BuildServiceProvider();
var client = serviceProvider.GetRequiredService<IMinioClient>();

using var stream = File.OpenRead("test-data.json");

var putArgs = new PutObjectArgs()
    .WithBucket("spot-layouter-push")
    .WithObject("TestPut.json")
    .WithStreamData(stream)
    .WithObjectSize(stream.Length)
    .WithContentType("application/json");

await client.PutObjectAsync(putArgs);
  1. Have a test file greater than about 6MB
  2. Execute the code
  3. Error: NullReferenceException

Stacktrace

at Minio.DataModel.Response.NewMultipartUploadResponse..ctor(HttpStatusCode statusCode, String responseContent)
   at Minio.MinioClient.NewMultipartUploadAsync(NewMultipartUploadPutArgs args, CancellationToken cancellationToken)
   at Minio.MinioClient.PutObjectAsync(PutObjectArgs args, CancellationToken cancellationToken)

Expectations

  • Omission of calling WithSSL(...) should not cause an exception

Info

MinIO (NuGet): 6.0.2
MinIO (Server): 2024-02-06T21:36:22Z

@ramondeklein
Copy link
Contributor

https://minio.slack.com/archives/C3NDUB8UA/p1711617745393569 may also be related to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants