Kentico 13页面生成器在多站点实例上出现一致错误。

huangapple go评论63阅读模式
英文:

Kentico 13 pagebuilder consistent error on multi-site instance

问题

在我们的Kentico MVC实例上,我们托管了5个站点。我们在页面构建器中遇到了间歇性但一致的错误。似乎发生在切换下拉菜单中的站点时。它不是每次都发生,但我能够在5分钟内尝试后重现它。在加载页面构建器时,我们收到以下错误消息:

Kentico 13页面生成器在多站点实例上出现一致错误。

并在事件日志中:

事件 ID:5745511
事件类型:错误
事件时间:2023年3月15日 下午12:21:25
来源:Application_Error日志,应用程序中的异常
描述:消息:尝试重新加载管理界面。用户未在JWT令牌中找到,也未在当前虚拟上下文URL中找到。

异常类型:CMS.Helpers.InvalidVirtualContextException
堆栈跟踪:
在Kentico.Content.Web.Mvc.VirtualContextPrincipalRetriever.GetPrincipal(String jwtToken)中获取主体
在Kentico.Content.Web.Mvc.VirtualContextPrincipalAssigner.SetVirtualContextPrincipal(IVirtualContextPrincipalRetriever virtualContextPrincipalRetriever)中设置虚拟上下文主体
在CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler1 h, TArgs e)中调用事件处理程序 在CMS.Base.AbstractHandler.Raise[TArgs](String partName, List1 list, TArgs e, Boolean important)中引发事件
在CMS.Base.SimpleHandler2.RaiseExecute(TArgs e)中引发事件执行 在CMS.Base.SimpleHandler2.StartEvent(TArgs e)中开始事件
在System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()中执行
在System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)中执行步骤实现
在System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)中执行

正如我所说,似乎在我们在下拉菜单中切换不同站点并快速加载页面构建器时发生。显然,我已尝试重新加载应用程序界面,但一旦出现此错误,帐户似乎处于混乱状态。有时,除了当前正在处理的站点之外,注销所有CMS的尝试会有所帮助。如果一切都失败,重新启动MVC Azure应用服务将解决问题。

不起作用的方法包括:

  • 尝试不同的浏览器或隐身窗口
  • 注销并重新登录CMS
  • 在CMS中切换到不同站点再切换回来

这个问题发生在我们的开发人员、QA团队和客户身上。他们变得越来越沮丧。任何帮助将不胜感激。


根据Brenden的以下问题:

这些站点共享一个CMS,每个站点都有自己的云托管的Azure应用程序实例。因此,每个环境有6个应用程序实例(目前有2个环境,DEV和UAT)。应用程序前面没有防火墙或WAF,所有站点都使用SSL。

英文:

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:

Kentico 13页面生成器在多站点实例上出现一致错误。

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.

答案1

得分: 1

  • 验证你的哈希字符串盐对于所有MVC站点代码和CMS实例都是相同的。
  • 验证你拥有适当的域许可证密钥。
  • 验证你拥有适当的站点展示和管理URL。如果它们位于不同的域上,请确保你明确指定了这一点,并具有适当的许可证密钥。
    • 例如,devadmin.mydomain1.com(CMS)和https://dev.mydomain1.com(展示)需要同时具有许可证密钥,并添加到站点中作为适当的域。
    • 对于其他站点,你可以使用类似于devadmin.mydomain2.com和https://dev.mydomain2.com的方式。
  • 如果你正在运行域别名,请确保这些别名不包含在你的站点通用定义中。例如,如果使用localhost,请将其放在站点的“域别名”中,而不是放在通用选项卡上的实际站点定义中。
  • 我假设你正在使用进程内会话存储,你可能需要生成一个机器密钥并将其添加到你的配置文件中,或者使用类似SQL会话或Redis缓存的方式来处理CMS内的会话。
英文:

Things to verify in your application setup:

  • Verify your hash string salt is the same for all MVC site code AND the CMS instances
  • Verify you have the proper domain license keys
  • Verify you have the proper site presentation and administration URLs. If they are on different domains, make sure you are specifying that and have those proper license keys.
    -- For instance devadmin.mydomain1.com (CMS) and https://dev.mydomain1.com (presentation) need to have both license keys AND added in the site as the proper domains.
    -- Also for the other sites you can have something like devadmin.mydomain2.com and https://dev.mydomain2.com
  • If you are running domain aliases, be sure those are aliases and NOT in your site General definition. For instance, using localhost, put that in the Site > Domain Aliases and not in the actual definition of the site on the General tab.
  • I'm assuming you're using in-proc session storage, you may want to generate a machine key and add that to your configuration files OR use something like SQL Session or Redis Cache to handle the session within the CMS.

huangapple
  • 本文由 发表于 2023年3月15日 20:43:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/75744872.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定