-
Notifications
You must be signed in to change notification settings - Fork 5k
[BUG] PersistKeysToAzureBlobStorage: 'Unable to retrieve the decryption key.' #38586
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
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
@jsquire is there any update on this issue? |
@peterbomers, apologies for the delay. Can you clarify what in the keys.xml file is corrupted? You mentioned the dates seem wrong, but can you elaborate on why they are wrong? You also mentioned that the blob storage client is producing errors. Do you have a stack trace for that? |
The
The blob storage client isn't throwing exceptions. The |
The same issue is being reported here - dotnet/aspnetcore#33071 It doesn't appear to be specific to the blob data protection package, as the issue occurs when using Redis as well. |
This comment seems to indicate that the issue can occur when using the same blob for data protection across apps. @peterbomers are you using this same blob for multiple apps? |
No, its one app. Its deployed to Azure and uses a service plan with multiple instances. |
I see - but the fact that this issue is occurring with multiple data protection storage repositories points to this being an issue in the core DataProtection APIs as opposed to the blobs extension. Can you add your details to the linked issue - dotnet/aspnetcore#33071? |
I found the code path causing this issue. When the AzureBlobXmlRepository receives 404 from the blob-client it resets the local cached data. Apparently these 404 codes are also reported when there are network issues. (see docs) Once this happens the default key is no longer available for the KeyRingProvider. |
Great find! If I'm understanding correctly the issue stems from the ASP .NET data protection code base. Would you mind adding your findings to the linked issue? |
Hi @peterbomers. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
|
Given that the root issue is being tracked in the ASP .NET Core repo, I will go ahead and close out this issue. @peterbomers, feel free to reopen if there is anything specific to the extension that you believe should be addressed. |
Uh oh!
There was an error while loading. Please reload this page.
Library name and version
Azure.Extensions.AspNetCore.DataProtection.Blobs 1.3.2
Describe the bug
Re-opening #32592 because the issue still occurs.
(it was closed during holiday season)
The example of the corrupted keys file is still valid.
Especially the creation, activation and expiration dates are strange. Below the last 3 entries. (total file size = 67kb)
Our demand on the Data Protection feature is high and I suspect that the AzureBlobXmlRepository can't handle rotation when the blobstorage produces client errors. (ClientOtherError)
This is a stack trace when the decrypting of an antiforgery token fails.
Other data-protection parts suffer from the same issue.
Expected behavior
Rock solid key rotation with Azure Blob Storage as store.
Actual behavior
Corrupted keys.xml file as described above and data-loss due to missing decryption keys
Reproduction Steps
Environment
Azure App Service with .NET 6 runtime
The text was updated successfully, but these errors were encountered: