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

[BUG] CopyStatus is not correct when the blob is not a copied blob #25634

Closed
jeffhli opened this issue Dec 2, 2021 · 7 comments · Fixed by #26946
Closed

[BUG] CopyStatus is not correct when the blob is not a copied blob #25634

jeffhli opened this issue Dec 2, 2021 · 7 comments · Fixed by #26946
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@jeffhli
Copy link

jeffhli commented Dec 2, 2021

Library name and version

Azure.Storage.Blobs 12.11.0

Describe the bug

Now I have a blob that is uploaded to a container in a storage account. But when I get the blob properties and check the CopyStatus, the value is Pending which is odd that the blob is not a copied blob and is not being copied.

Expected behavior

For a blob that is not being copied, The CopyStatus should be null.

Actual behavior

Pending

Reproduction Steps

  1. Upload a blob.
  2. Get the blob properties
  3. Check the CopyStatus

Environment

No response

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 2, 2021
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. CXP Attention needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files) labels Dec 2, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 2, 2021
@ghost
Copy link

ghost commented Dec 2, 2021

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

@SaurabhSharma-MSFT
Copy link
Member

@jeffhli We are looking into this and get back to you.

@MughundhanRaveendran-MSFT

@jeffhli , Could you please share the code that you are using to retrieve the copy status?

I am using the below method to retrieve the properties of the uploaded blob but that doesn't give me the copy status

https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-properties-metadata?tabs=dotnet#set-and-retrieve-properties

@jeffhli
Copy link
Author

jeffhli commented Dec 4, 2021

BlobServiceClient serviceClient = new BlobServiceClient(connectionString);
var container = serviceClient.GetBlobContainerClient(containername);
var blob = container.GetBlobClient(blobId);
await blob.UploadAsync(filepath);
BlobProperties destProperties = await blob.GetPropertiesAsync();

Console.WriteLine($"Copy Id: {destProperties.CopyId}");
Console.WriteLine($"Copy status: {destProperties.CopyStatus}");
Console.WriteLine($"Copy progress: {destProperties.CopyProgress}");
Console.WriteLine($"Completion time: {destProperties.CopyCompletedOn}");
Console.WriteLine($"Total bytes: {destProperties.ContentLength}");

Then the result is Copy status: Pending

@MughundhanRaveendran-MSFT

@jeffhli , Thanks for your response. I am able to reproduce the issue at my end. We will triage and let you know the progress.

@MughundhanRaveendran-MSFT MughundhanRaveendran-MSFT added the Service Attention Workflow: This issue is responsible by Azure service team. label Dec 21, 2021
@ghost
Copy link

ghost commented Dec 21, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details

Library name and version

Azure.Storage.Blobs 12.11.0

Describe the bug

Now I have a blob that is uploaded to a container in a storage account. But when I get the blob properties and check the CopyStatus, the value is Pending which is odd that the blob is not a copied blob and is not being copied.

Expected behavior

For a blob that is not being copied, The CopyStatus should be null.

Actual behavior

Pending

Reproduction Steps

  1. Upload a blob.
  2. Get the blob properties
  3. Check the CopyStatus

Environment

No response

Author: jeffhli
Assignees: MughundhanRaveendran-MSFT
Labels:

Storage, Service Attention, Client, customer-reported, question, needs-team-attention, CXP Attention

Milestone: -

@jaschrep-msft
Copy link
Member

This appears to be a similar issue to #19263. While the poster of that issue was assuming the object would update, they ended up hitting this situation after making recommended changes.

I have reproduced this issue with the provided sample, and it stems from BlobProperties.CopyStatus being of type CopyStatus and not CopyStatus?, combined with the enum getting no None = 0 value from the code generation process. Pending is the 0-value and so will show up even when the x-ms-copy-status header isn't present in the HTTP response.

This also means there's no clean way to fix this issue without introducing a breaking API change. While a boolean flag could be introduced alongside the property, that is a less-than-desirable API design. Will discuss this with the team.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants