Friday, August 21, 2020

Sitecore XC (9.3) Fix for Sitecore.XConnect.Client.XdbModelConflictException -One or more local models conflict with the xDB service layer.

 Recently, We have done a scaled environment setup and found this error in the logs (Sitecore XP)

Exception details: Sitecore.XConnect.Client.XdbModelConflictException

Message: One or more local models conflict with the xDB service layer.

'RegisterConnectEventModel, 0.1' does not have a remote version

Source: Sitecore.Xdb.Common.Web

at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory)

at Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock(Func`1 taskFactory)

at Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.Initialize(XmlNode configNode)

at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)

at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert)

at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert)

at Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient(String clientConfigPath)

at Sitecore.Analytics.XConnect.DataAccess.BatchEnabledXdbRuntimeContext..ctor(IXdbContextFactory factory)

at Sitecore.Analytics.Events.BatchEventHandler.OnBatchStarting(Object sender, EventArgs args)

at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)

Steps to fix - the error is pointing that issue withing xConnect models - We checked all the modes in Sitecore rules 

Example path - 

C:\inetpub\wwwroot\xconnect.dev.local\App_Data\Models

C:\inetpub\wwwroot\xconnect.dev.local\App_Data\jobs\continuous\IndexWorker\App_Data\Models

We noticed both models are the same, After investigating it further we noticed that on XP leading site there was only one model, We copied the existing model from below path and updated the xConnect (Removed all others)

C:\inetpub\wwwroot\<siteName>.xconnect\App_data\Models

that change resolved the issue.

Troubleshooting steps and fix - Sitecore XC (9.3) products are not showing in a scaled environment.

Recently, We have done a scaled environment setup and found that the product catalog was not showing in the site.

Investigation steps -  

1. We checked in the Index (sitecore_master_index) and found that product data were missing.

Click on the page, check the sxa URL, solr log and generate the query, As the example below.

https://localhost:8983/solr/axp93_master_index/select?q=((((((((_path:(8174413cc73369a0d61b6ca583c234d4)+AND+commercesearchitemtype_t:(sellableitem))+AND+_latestversion:(True))+AND+excludefromwebsitesearchresults_b:(False))+AND+parentcataloglist_sm:(59ddadc19b88727e9e143f6cf321ae0f))+AND+_parent:(8174413cc73369a0d61b6ca583c234d4))+AND+(_path:(e28e09d9d1534f58a88c66774a19eb5c)+AND+searchable_b:(True)))+AND+_language:(en))+AND+_latestversion:(True))&facet.field=typeofgood_s&facet.field=manufacturer_s&facet.field=brand_s&f.brand_s.facet.mincount=1&start=0&f.typeofgood_s.facet.mincount=1&fq=_indexname:(sitecore_master_index)

2. We verified all logs and found Minion services was trying to hit the wrong master SearchScopeName  name was ( abc_master_index) and showing 404 errors, that points me that something is wrong in the configuration.

We checked the configuration of all four Sitecore roles here, the example below 

C:\inetpub\wwwroot\CommerceAuthoring_xyz\wwwroot\data\Environments\PlugIn.Search.Solr.PolicySet-1.0.0.json

and fixed the index name, it should be the same as XP - master or web.
    



Solution - Please verify the scope in all four roles - PlugIn.Search.Solr.PolicySet-1.0.0.json and correct it that will resolve the issue.