1

I am using Sitecore 9.1 Azure. Recently I deployed the XConnect custom model and other required files on 5 roles referring to the link https://doc.sitecore.com/xp/en/developers/100/sitecore-experience-platform/deploy-a-custom-model.html

The roles are given below where I deployed:

ma-rep
ma-ops
xc-collect
xc-refdata
xc-search

But I am getting the below error. Any idea what am I missing?

does not have a remote version Exception: Sitecore.XConnect.Client.XdbModelConflictException Message: One or more local models conflict with the xDB service layer. 'CustomModel, 1.0' does not have a remote version

3 Answers 3

0

Issue is with the json file version, try creating the json file again and update it.

Generating json file:

var model = Sitecore.XConnect.Serialization.XdbModelWriter.Serialize(specify your model);

File.WriteAllText(specifypath and name + ".json", model);

you can write a simple console application to generate json or you can proceed with normal process.

1
  • Already did multiple times but no impact. Sep 20, 2022 at 14:08
0

First, you need to register the custom facet model:

public static class CustomerCollectionModel
    {
        public static XdbModel Model { get; } = CreateModel();
 
        private static XdbModel CreateModel()
        {
 
            XdbModelBuilder builder = new XdbModelBuilder("CustomFacets.Xconnect.CustomerCollectionModel", new XdbModelVersion(1, 0));
            builder.ReferenceModel(Sitecore.XConnect.Collection.Model.CollectionModel.Model);
            builder.DefineFacet<Contact, CustomerStatus>(CustomerStatus.DefaultFacetKey);
            return builder.BuildModel();
        }
    }

Then, You need to serialize the collection model in which you defined your custom facet model. To serialize into JSON using the below code:

var model = Sitecore.XConnect.Serialization.XdbModelWriter.Serialize(CustomerCollectionModel.Model);
            File.WriteAllText(CustomerCollectionModel.Model.FullName + ".json", model);

On execution of the console application, it will generate a JSON file at bin/Release folder. Copy that JSON file and paste at the below places:

Deploy the JSON file to the below locations on Azure:

<Instance-Name>-xc-search -> App_Data/Models
<Instance-Name>-xc-search -> App_Data/jobs/continuous/IndexWorker/App_data/Models
<Instance-Name>-xc-collect -> App_Data/Models
<Instance-Name>-xc-refdata -> App_Data/Models
<Instance-Name>-ma-ops -> App_Data/Models

For more details, refer to this blogpost https://sitecorewithraman.wordpress.com/2021/06/06/deploying-xconnect-customizations-on-azure/

1
  • I already have all these configurations correctly. And with same configurations it works fine on my dev environment but broken on UAT. The only difference between dev and UAT is dev has single CD whereas UAT has 2 CDs but I think that should not impact functionality of Xconnect. I checked the logs and the error is only in ma_ops role though this role has single Model file and that also looks updated. Sep 24, 2022 at 14:38
0

The issue was that sometimes updated XConnect models do not properly load. So we have to perform the following steps in order to fix the issue:

Please ensure that you didn't miss any steps from the following article: https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-platform/deploy-a-custom-model.html

Then execute following steps:

  1. Restart all xconnect web apps;

  2. Restart the "AutomationEngine" web job. To do so please go to "ma-ops" web app->Web Jobs->Automation Engine and click "stop" and then "start":

Please note that Azure WebJobs are used for running IndexWorker, AutomationEngine, and ProcessingEngine services for Cloud environments. Service files are copied to the D:\local\Temp\jobs\continuous folder and run from this directory.

Please ensure that your custom model is deployed to these folders too. in the Azure Portal, find the related xConnect App Service. using KUDU, navigate to the App_data folder for the corresponding WebJob as follows: D:\local\Temp\jobs\continuous\JOB-NAME\RANDOM-NAME\App_data\Models folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.