CDインスタンスで「publish:end:remote」イベントのCustomRenderingViewPathCacheClearerハンドラーが失敗する


解説

スケーリングされた環境でSXAモジュールを使用する際に、CMインスタンス上のデータベースの名前がリモート インスタンス上のデータベースの名前と一致しない場合、パブリッシュ後にログ レコードにエラーが記録されることがあります。

例えば、CMに2つのWebデータベースが「web」と「web2」として構成されている場合、次のようになります:
CD1は、CMから「web」として参照されるデータベースを使用する。
CD2は、CMから「web2」として参照されるデータベースを使用する。

この状態でCMから「web」および「web2」へのパブリッシュを実行すると、CD2で次のエラーが発生する可能性があります:

ERROR One or more exceptions occurred while processing the subscribers to the 'publish:end:remote' event.
Exception[1]: System.InvalidOperationException
Message[1]: Could not find configuration node: databases/database[@id='web2']
Source[1]: Sitecore.Kernel
at Sitecore.Configuration.DefaultFactory.GetConfigNode(String xpath, Boolean assert)
at Sitecore.Configuration.DefaultFactory.CreateObject(....)
at Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert)
at Sitecore.Configuration.DefaultFactory.GetDatabase(String name)
at Sitecore.XA.Foundation.Mvc.EventHandlers.CustomRenderingViewPathCacheClearer.
OnPublish(....)
at Sitecore.XA.Foundation.Caching.EventHandlers.
CacheClearerBase.OnPublishEndRemote(...)
at Sitecore.Events.Event.EventSubscribers.RaiseEvent(...)

解決策

この問題を解決するには、次のいずれかのオプションを検討してください: