azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

[BUG]The result of SyncCopyFromUriAsync may be corrupted

Open hitsjt opened this issue 1 year ago • 3 comments

Library name and version

Azure.Storage.Blobs 12.14.0

Describe the bug

We use SyncCopyFromUriAsync to copy head images from Wechat to our own azure blob. Sometimes the copied images are corrupted, losing some bytes at the end of file.

Expected behavior

Copied image should be integrated and same as the original ones.

Actual behavior

Sometimes,the copied images are corrupted,losing some bytes at the end of file. For example,jpeg files lose EOI marker. lose_eoi

Reproduction Steps

public async Task<Uri> SyncCopyFromUriAsync(string containerName, string blobPath, Uri srcUri, string contentDisposition = "")
       {
            var blobClient = await this.GetBlobClientAsync(containerName, blobPath);
            await blobClient.SyncCopyFromUriAsync(srcUri);
            if (!string.IsNullOrWhiteSpace(contentDisposition))
            {
                var httpHeaders = new BlobHttpHeaders() 
                { 
                    ContentDisposition = contentDisposition 
                };

                await blobClient.SetHttpHeadersAsync(httpHeaders).ConfigureAwait(false);
            }

            return blobClient.Uri;
        }

Environment

Docker in k8s with .NET runtimes installed: Microsoft.AspNetCore.App 6.0.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

IDE:VS2022 17.4.3

hitsjt avatar Jan 04 '23 06:01 hitsjt

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Jan 04 '23 13:01 ghost

@hitsjt Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

navba-MSFT avatar Jan 05 '23 08:01 navba-MSFT

Issue is being discussed internally with the Storage .Net Devs.

navba-MSFT avatar Jan 10 '23 10:01 navba-MSFT

@hitsjt As discussed internally over email, please file an ICM and this issue would be looked further on that.

navba-MSFT avatar Jan 11 '23 04:01 navba-MSFT