On our Kentico MVC instance, we host 5 sites. We are getting an intermittent, but consistent error in the page builder. It seems to happen when switching between sites in the drop down menu. It's inconsistent,in that it doesn't happen every time, but I am able to reproduce it within 5 minutes of trying. On loading the pagebuilder, we receive:
and in the event log:
Event ID:5745511
Event type:Error
Event time:15/03/2023 12:21:25 PM
Source:Application_Error log, exception in application
Description:Message: Try reloading the administration interface. The user was not found in the JWT token, nor in the current virtual context URL.
Exception type: CMS.Helpers.InvalidVirtualContextException
Stack trace:
at Kentico.Content.Web.Mvc.VirtualContextPrincipalRetriever.GetPrincipal(String jwtToken)
at Kentico.Content.Web.Mvc.VirtualContextPrincipalAssigner.SetVirtualContextPrincipal(IVirtualContextPrincipalRetriever virtualContextPrincipalRetriever)
at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler`1 h, TArgs e)
at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List`1 list, TArgs e, Boolean important)
at CMS.Base.SimpleHandler`2.RaiseExecute(TArgs e)
at CMS.Base.SimpleHandler`2.StartEvent(TArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Like I said, it seems to happen when we switch between different sites in the drop down and load the page builders too quickly. Obviously, I have tried reloading the application interface, but once we receive this error, the account seems to be in a messed up state. We have had luck logging out of all the CMS's except for the one currently being worked on - sometimes. If all else fails, restarting the MVC azure app service resolves it.
Things that don't work:
- trying a different browser or incognito window
- logging out and back in to the CMS
- switching to a different site in the CMS and back
This is happening to our devs, QA team, and client. It's becoming increasingly frustrating for them. Any help would be appreciated.
Per Brenden's questions below:
The sites share a CMS, and each has it's own cloud-hosted azure app instance. So 6 app instances per environment (2 environments currently, DEV and UAT). No firewall or WAF is in front of the application, and all sites are using SSL.