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

The issue from System.Text.Json in 5.0.0 #842

Open
leolcao opened this issue Aug 17, 2023 · 3 comments
Open

The issue from System.Text.Json in 5.0.0 #842

leolcao opened this issue Aug 17, 2023 · 3 comments

Comments

@leolcao
Copy link

leolcao commented Aug 17, 2023

Hi minio team, I found one special issue from Minio nuget package 5.0.0.

The exception log message is like:

Upload d:\Storage\L-001\Part1.bmp to L-001/Part1.bmp failed: The type 'System.ReadOnlySpan`1[System.Byte]' of property 'Span' on type 'System.ReadOnlyMemory`1[System.Byte]' is invalid for serialization or deserialization because it is a pointer type, is a ref struct, or contains generic parameters that have not been replaced by specific types. from System.Text.Json
[2023-08-16 19:19:42.425 +08:00 INF] [2023-08-16 7:19:42 PM Info MinioUploader]Not find L-001/Part1.bmp: MinIO API responded with message=Not found. from Minio

I found the version 4.0.7 is good for the same file. I searched the release ntoes, and find the related updates in 5.0.0 from Compat Span, does it relavant to this issue?

4.0.7...5.0.0

The sample code is like:

// upload
                fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);

                var poa = _putObjectArgs?
                    .WithObject(objName)
                    .WithStreamData(fs)
                    .WithObjectSize(fs.Length)
                    .WithContentType("application/octet-stream");
                // Upload a file to bucket.
                await _client.PutObjectAsync(poa);

                fs.Close();
...
                _logger?.Error($"Upload {filePath} to {objName} failed: {e.Message} from {e.Source}");

The environment info is:

  • VS 2022 Community
  • .NET SDK 6.0 LTS
  • ASP.NET Core 6.0
  • Minio 5.0.0
@martijn00
Copy link
Contributor

@leolcao can you post the full stacktrace? This might have something to do with switching to ReadOnlyMemoryContent for a request on .NET6.

A lot of new work has already been done on it but is not released on Nuget yet. Could you run your test from the latest source code on this repo?

@leolcao
Copy link
Author

leolcao commented Aug 24, 2023

hi @martijn00 , sorry, although I would like to help for such things, I don't have time to do that, or you may wait long time to get some results from me ~
I also have some interesting on the System.ReadOnlySpan stuff, but not sure when can give back some findings~

@leolcao
Copy link
Author

leolcao commented Nov 10, 2023

This issue still have in the minio-dotnet 6.0.0 version.

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