minio / minio-dotnet

MinIO Client SDK for .NET
https://docs.min.io/docs/dotnet-client-quickstart-guide.html
Apache License 2.0
547 stars 216 forks source link

Uploads file > 5mb failed #715

Open vuonghung12 opened 1 year ago

vuonghung12 commented 1 year ago

Hi, when I upload: Small files work, >5mb fails. I run minio on docker and it's behind a nginx reverse proxy. I can upload big files using the web-ui the dotnet minio library however always fails if the file is bigger than 5 mb minio 4.6, net6

-- minio behind a nginx reverse proxy exception message: MinIO API responded with message=The specified key does not exist.

StackTrace:

   at Minio.MinioClient.ParseErrorFromContent(ResponseResult response)
   at Minio.MinioClient.ParseError(ResponseResult response)
   at Minio.MinioClient.HandleIfErrorResponse(ResponseResult response, IEnumerable`1 handlers, DateTime startTime)
   at Minio.MinioClient.<ExecuteTaskCoreAsync>d__181.MoveNext()
   at Minio.MinioClient.<NewMultipartUploadAsync>d__83.MoveNext()
   at Minio.MinioClient.<PutObjectAsync>d__63.MoveNext()

code:

IFormFile image...
var args = new PutObjectArgs()
                    .WithBucket(bucketName)
                    .WithObject(objectName)
                    .WithObjectSize(image.Length)
                    .WithContentType(image.ContentType)
                    .WithStreamData(image.OpenReadStream());
await minio.PutObjectAsync(args);
harshavardhana commented 1 year ago

share your nginx configuration? @vuonghung12

vuonghung12 commented 1 year ago

@harshavardhana i'm using nginx proxy manager with config from https://min.io/docs/minio/linux/integrations/setup-nginx-proxy-with-minio.html

vuonghung12 commented 1 year ago

after some nginx config, I had move to another error InnerException: {" was not expected."} Message: "There is an error in XML document (1, 2)." StackTrace:

 at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
   at Minio.NewMultipartUploadResponse..ctor(HttpStatusCode statusCode, String responseContent)
   at Minio.MinioClient.<NewMultipartUploadAsync>d__83.MoveNext()
   at Minio.MinioClient.<PutObjectAsync>d__63.MoveNext()
   at Services.Helper.Common.<UploadFormFileToMinio>d__10.MoveNext() in 
kannappanr commented 1 year ago

@vuonghung12 Can you connect directly to MinIo and bypass the nginx configuration?

vuonghung12 commented 1 year ago

@kannappanr I tried but not work, this have error like issue #716

ebozduman commented 1 year ago

@kannappanr I tried but not work, this have error like issue #716

@vuonghung12,

So, you are saying this issue became duplicate of #716 after making changes in your nginx configuration, right? If that is correct, please close this one as duplicate off #716 or vice versa.

vuonghung12 commented 1 year ago

@ebozduman this is my flow behind nginx: check bucket exist (OK) => upload (NG - #715) direct ip: check bucket exist (NG - #716 ) => upload (....)

here is the trace when I upload failed image

I think it return "The specified key does not exist." because s3.GetObject return 404 while s3.ListMultipartUploads not finished yet

eldenis commented 1 month ago

This is also happening to me on both a local minio deployment on dietpi and on a contabo S3 bucket that runs on Ceph. I switched to using the AWS nuget and it works fine on both.

ebozduman commented 1 month ago

@eldenis

Please confirm you used the latest (currently available) nuget in your scenario.

We've addressed quite a bunch of issues in the coming package. As soon as our tests are complete, there will be a new dotnet sdk release.

eldenis commented 1 month ago

@ebozduman Yes, I am using the latest nuget.

Glad to hear a new package is coming out soon! Thanks!