[Bug] - UI freezes and DefaultAntiforgery error
- Dominant language
- C#
- Stars
- 4.7k
- Forks
- 822
- PR merge metrics
- No merged PRs in 30d
Description
**Bug**
UI freezes and DefaultAntiforgery error
**Bug description**
Covenant UI freezes after sometime post launching. Please see the attached screenshot. We need to refresh the page in order to get rid of the error. However, post refresh the error still appears.

What I have noticed is that, there is web socket in the browser which sends heartbeats and seems like the heartbeat fails after 3 attempts. Please see the attached screenshot.

I can see the below exception in the logs.
```
Found default JwtKey, replacing with auto-generated key...
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
warn: Microsoft.EntityFrameworkCore.Model.Validation[10400]
Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data, this mode should only be enabled during development.
Covenant has started! Navigate to https://127.0.0.1:7443 in a browser
Creating cert...
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {1cc9069f-f711-4a94-ac9b-8b26690bf045} may be persisted to storage in unencrypted form.
fail: Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery[7]
An exception was thrown while deserializing the token.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
---> System.Security.Cryptography.CryptographicException: The key {77b3e1fc-406a-46ec-9917-f57661b2a94f} was not found in the key ring.
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData, Boolean ignoreRevocationErrors, Boolean& requiresMigration, Boolean& wasRevoked)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] 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)
```
Note: I have deleted the image and recreated a fresh docker image on the problematic instance but still the issue exists. I provisioned a fresh instance and did a new installation from scratch and unable to replicate the issue. In fact I tried to reproduce this behaviour by doing fresh installation on newly provisioned vms many times and unable to replicate this behaviour anymore.
**To Reproduce**
No reproduction steps
**Covenant Server Information:**
- OS: Ubuntu 20.04.3 LTS
- Docker
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.