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

Minio 6.0.2 - GetObjectAsync doesn't work properly with .NET 8 #1027

Open
dawcza3 opened this issue Mar 3, 2024 · 1 comment
Open

Minio 6.0.2 - GetObjectAsync doesn't work properly with .NET 8 #1027

dawcza3 opened this issue Mar 3, 2024 · 1 comment

Comments

@dawcza3
Copy link

dawcza3 commented Mar 3, 2024

Hi,

I have a problem after migration to latest minio version (from 5.0.0 to 6.0.2). I'm trying to download a file using GetObjectAsync in following way:

 byte[] fileResult = null;
 var args = new GetObjectArgs()
                .WithBucket(bucketName)
                .WithFile(fileName)
                .WithObject(fileName)
                .WithCallbackStream(stream =>
                {
                    byte[] buffer = new byte[16 * 1024];
                    using (MemoryStream ms = new MemoryStream())
                    {
                        int read;
                        while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
                        {
                            ms.Write(buffer, 0, read);
                        }
                        fileResult = ms.ToArray();
                    }
                });

            var result = await minioClient.GetObjectAsync(args, cancellationToken);

            return fileResult;       

but it always return information that file have 0 size. Did something change from version 5 - do I have to construct args in different way to find and download my existing files ?

@dawcza3 dawcza3 changed the title Minio 6.0.2 - GetObjectAsync doesn't working properly with .NET 8 Minio 6.0.2 - GetObjectAsync doesn't work properly with .NET 8 Mar 3, 2024
@holterbades
Copy link
Contributor

Probably you encounter an exception while downloading the object from the object-store. It's probably the same issue described in #1041. If you try the version 6.0.1 this error will probably vanish.

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