0

I've added a custom facet and model, serialized the model and deployed it to my xConnect server to the two locations outlined in Sitecore's documentation but I'm still seeing this error. Because of the error the site cannot start the tracker so I'm unable to record any interactions about users.

I'm running 9.1 locally using the Standalone role.

Model

public class AgentInfoModel
{
    public static XdbModel Model { get; } = AgentInfoModel.BuildModel();

    private static XdbModel BuildModel()
    {
        XdbModelBuilder modelBuilder = new XdbModelBuilder("AgentInfoModel", new XdbModelVersion(1, 0));

        modelBuilder.DefineFacet<Contact, ContactAgentInfo>(ContactAgentInfo.DefaultFacetKey);
        modelBuilder.ReferenceModel(Sitecore.XConnect.Collection.Model.CollectionModel.Model);

        return modelBuilder.BuildModel();
    }
}

JSON:

"Name": "ContactAgentInfo",
"Version": "1.0",
"References": [
{
  "Name": "XConnect",
  "Version": "1.0"
}
],
"Types": {
"USCM.Foundation.Agency.Facets.ContactAgentInfo": {
  "Type": "Facet",
  "BaseType": "Sitecore.XConnect.Facet",
  "ClrType": "USCM.Foundation.Agency.Facets.ContactAgentInfo, USCM.Foundation.Agency.Facets, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
  "Properties": {
    "UserID": {
      "Type": "String"
    },
    "HideSplashContent": {
      "Type": "Boolean"
    },
    "HideSplashContentStatus": {
      "Type": "String"
    },
    "LastVisitedDateUTC": {
      "Type": "DateTime"
    },
    "RefreshDateUTC": {
      "Type": "DateTime"
    },
    "AgentState": {
      "Type": "String"
    },
    "DPecID": {
      "Type": "String"
    },
    "DPecUserType": {
      "Type": "String"
    }
  }
}
},
"Facets": [
{
  "Target": "Contact",
  "Name": "ContactAgentInfo",
  "Type": "USCM.Foundation.Agency.Facets.ContactAgentInfo"
}
]

Error:

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

  • 1
    Can you post your model and your json file contents. – Chris Auer Mar 8 at 0:10
  • And please do not forget to post the error message you are getting. – Hugo Santos Mar 8 at 14:13
  • Try remove the line modelBuilder.ReferenceModel(Sitecore.XConnect.Collection.Model.CollectionModel.Model); – Mark Gibbons Mar 9 at 2:02
  • Also triple check you've followed the deployment instructions correctly. It needs to go in your standalone instance and the json needs to go in two different places on your xconnect instance. Lastly you need an xml config for your marketing automation service. – Mark Gibbons Mar 9 at 2:04
  • @MarkGibbons: in addition to the changing the name, your advice to remove the ReferenceModel also was important. I had created the json manually and neglected to add the reference to CollectionModel.Model in the json. – Jason Davidson Mar 11 at 22:21
3

Your model builder is making a model named "AgentInfoModel". But the JSON you posted is for a model called "ContactAgentInfo". The Name field of you JSON should match the name and version you specified on the XdbModelBuilder class.

I believe you may have renamed your model at some point and forgot to regenerated your json model.

This

XdbModelBuilder("AgentInfoModel", new XdbModelVersion(1, 0))

Does not match this:

{
   "Name": "ContactAgentInfo",
   "Version": "1.0",
   "References": [
   {
      "Name": "XConnect",
      "Version": "1.0"
   }
}

One last thing, you mentioned logging user interactions. When you want to use your facet for interactions, you need to define your facet as an Interaction facet in the builder. Your facet is currently defined as a Contact facet.

modelBuilder.ReferenceModel(Sitecore.XConnect.Collection.Model.CollectionModel.Model);

modelBuilder.DefineFacet<Interaction, ContactAgentInfo>(ContactAgentInfo.DefaultFacetKey);```

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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