minio-dotnet icon indicating copy to clipboard operation
minio-dotnet copied to clipboard

Uploads file > 5mb failed

Open vuonghung12 opened this issue 2 years ago • 10 comments

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);

vuonghung12 avatar Nov 21 '22 04:11 vuonghung12

share your nginx configuration? @vuonghung12

harshavardhana avatar Nov 21 '22 07:11 harshavardhana

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

vuonghung12 avatar Nov 21 '22 09:11 vuonghung12

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 

vuonghung12 avatar Nov 21 '22 16:11 vuonghung12

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

kannappanr avatar Nov 22 '22 01:11 kannappanr

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

vuonghung12 avatar Nov 22 '22 01:11 vuonghung12

@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.

ebozduman avatar Nov 22 '22 22:11 ebozduman

@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

vuonghung12 avatar Nov 23 '22 02:11 vuonghung12

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.

eldenis avatar Jun 10 '24 14:06 eldenis

@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.

ebozduman avatar Jun 11 '24 00:06 ebozduman

@ebozduman Yes, I am using the latest nuget.

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

eldenis avatar Jun 11 '24 14:06 eldenis