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] Caching and BlobClient.DownloadAsync() Response x-ms-client-request-id does not match the original expected request id #24635

Closed
simader opened this issue Oct 11, 2021 · 7 comments
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. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. 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

@simader
Copy link

simader commented Oct 11, 2021

In an .netFramework-Project with requestCaching activated the second time a blob is requested, a RequestFailedException is thrown.

Azure.RequestFailedException: 'Response x-ms-client-request-id '3742a081-3d05-493e-9b97-c5cbcd70c659' does not match the original expected request id, '890534a7-43be-46b7-bcd0-f6c3e3cfef12'.

if caching is deactivated it works fine.

<system.net>
    <requestCaching isPrivateCache ="true" disableAllCaching="false" defaultPolicyLevel="CacheIfAvailable" unspecifiedMaximumAge="7.00:00:00" />
  </system.net>

Environment:

  • Name and version of the Library package used: Azure.Storage.Blobs 12.10.0 (newest)
  • Hosting platform: .net Framework 4.7.2

AzureBlobBug.zip

@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 Oct 11, 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 Oct 11, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 11, 2021
@ghost
Copy link

ghost commented Oct 11, 2021

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

@SaurabhSharma-MSFT SaurabhSharma-MSFT self-assigned this Oct 11, 2021
@SaurabhSharma-MSFT SaurabhSharma-MSFT added Service Attention Workflow: This issue is responsible by Azure service team. and removed CXP Attention labels Oct 14, 2021
@ghost
Copy link

ghost commented Oct 14, 2021

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

Issue Details

In an .netFramework-Project with requestCaching activated the second time a blob is requested, a RequestFailedException is thrown.

Azure.RequestFailedException: 'Response x-ms-client-request-id '3742a081-3d05-493e-9b97-c5cbcd70c659' does not match the original expected request id, '890534a7-43be-46b7-bcd0-f6c3e3cfef12'.

if caching is deactivated it works fine.

<system.net>
    <requestCaching isPrivateCache ="true" disableAllCaching="false" defaultPolicyLevel="CacheIfAvailable" unspecifiedMaximumAge="7.00:00:00" />
  </system.net>

Environment:

  • Name and version of the Library package used: Azure.Storage.Blobs 12.10.0 (newest)
  • Hosting platform: .net Framework 4.7.2

AzureBlobBug.zip

Author: simader
Assignees: SaurabhSharma-MSFT
Labels:

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

Milestone: -

@SaurabhSharma-MSFT SaurabhSharma-MSFT removed their assignment Oct 14, 2021
@SaurabhSharma-MSFT
Copy link
Member

SaurabhSharma-MSFT commented Oct 14, 2021

@simader We are doing investigation on the same. We will get back to you.

@amishra-dev
Copy link
Contributor

@kasobol-msft Kamil could you please look at this?

@kasobol-msft
Copy link
Contributor

@simader Could you explain why would you want system.net cache to cache storage responses while using the SDK? Couple of thoughts why this might not be best idea.

The Blob SDK (and other Storage SDKs) check if request id sent to service is replied back by the service in a policy that's applied to every request, see here.
Many features of the SDK won't work correctly if there's no exchange with the service, thus resulting in possible bugs in the apps.

The caching mechanism present in .NET Framework hasn't been carried forward (see here). Usage of such a global cache can be source of many errors in the app. We recommend against using it.
Instead we recommend to cache results of the SDK calls in memory if that's something you desire. Alternatively, if you still pursue the global request caching, I'd recommend to use raw HttpClient or WebRequest to download resources - as I mentioned we can't guarantee correctness of the SDK implementation if blobal system.net cache is enabled (for example when we chunk the downloads).

@kasobol-msft kasobol-msft added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Oct 15, 2021
@ghost ghost removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Oct 15, 2021
@amishra-dev amishra-dev added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Oct 29, 2021
@ghost
Copy link

ghost commented Oct 29, 2021

Hi @simader. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@ghost ghost removed the needs-author-feedback Workflow: More information is needed from author to address the issue. label Oct 29, 2021
@simader
Copy link
Author

simader commented Oct 29, 2021

Hello,
Yes, we removed this caching again, because of some other unexpected behaviour.
Best,
Andreas

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. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. 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

No branches or pull requests

5 participants