Skip to main content

I have a customer who is getting the below message and their non prod environment is unusable. Would they need to reach out to MS as this is a Microsoft exception?

 

Category: Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery
EventId: 7
SpanId: 0309bd647ee93dbb
TraceId: 4cefed6e1e4819386f968508f75281dc
ParentId: 0000000000000000
RequestId: 8000006e-0001-c000-b63f-84710c7967bb
RequestPath: /FSMCRP/WebClient/
ActionId: 409bced6-9d2e-4714-9d82-c18a59db81bc
ActionName: FSM.WebClient.Server.Controllers.HomeController.Index (FSM.WebClient)

An exception was thrown while deserializing the token.

Exception: 
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
 ---> System.Security.Cryptography.CryptographicException: The key {accf16bb-cd1f-4afc-ad53-f12920cef1ca} was not found in the key ring. For more information go to http://aka.ms/dataprotectionwarning
   at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte(] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
   at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Bytec] protectedData)
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetCookieTokenDoesNotThrow(HttpContext httpContext)

Hi Ann,

can you please provide more details, e.g. environment setup / architecture details, load balancing in-place?

I saw this error once for a customer who had load balancing. Basically, it might be related to the load balancer configuration (persistency?) and eventually incorrect configured FSM endpoints.
 

Best regards
Roman


@roklde they do have load balancing in place, that I know for sure. I have also asked the customer if they could do a comparison of their OS level and .Net version from their CRP environment that is having the issue against an environment that is working properly. 


@Ann Degroat they need to make sure that the recommendations for load balanced environments are implemented as described in the Installation guide:
 

Especially, the last point is crucial to avoid any issues with user sessions.

Best regards
Roman


Hi! We don’t have load balance configured for one of our customer and this error does happen all the time… Can you help me figure out what’s going on?


Hi Elaine,

is it exactly the same error as stated above? How does the Infra Setup look like?

 

Best regards
Roman


Hi Elaine,

is it exactly the same error as stated above? How does the Infra Setup look like?

 

Best regards
Roman

Yes, it is! Look…

 

Category: Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery
EventId: 7
SpanId: 4a6cffdfbab9ed97
TraceId: 23ac2d585d46f866e0d0c09e30ffb3ac
ParentId: 0000000000000000
RequestId: 80003617-000d-2e00-b63f-84710c7967bb
RequestPath: /FSMServerPRD/WebClient/tab/screen/TASK/afd3f071-6d6c-4f6a-aa76-5b2ebfbf4f9b
ActionId: f958b038-eb6d-45cd-8b2c-aa1b89f0aa23
ActionName: FSM.WebClient.Server.Controllers.HomeController.Index (FSM.WebClient)

An exception was thrown while deserializing the token.

Exception: 
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
 ---> System.Security.Cryptography.CryptographicException: The key {f2d58997-5ea8-44ac-9a8d-8425b79f28e1} was not found in the key ring. For more information go to http://aka.ms/dataprotectionwarning
   at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(ByteC] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
   at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byter] protectedData)
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
   at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetCookieTokenDoesNotThrow(HttpContext httpContext)
 


@BerenguerE how often does it happen? This can also happen when the FSM App Pool is recycled. Thus, please check the timestamps in the Windows Events for this error as well as for Recycle Events (under custom views > web server (iis)). Further, browser cookies also may play a role. e.g. when switching between normal and incognito mode and/or using different url (e.g. localhost vs. actual hostname).

 

Best regards
Roman


Reply