3

I've deployed 2 versions of a custom xConnect model I created called DetailModel.
According to the documentation, the xConnect models' unique name is name of model + version.

The model’s full name (represented by the FullName property of the XdbModel class) includes the model’s name and version. For example: DocumentationModel,1.0.

Described here: https://doc.sitecore.com/developers/90/sitecore-experience-platform/en/create-a-model.html

I have deployed both models:

  • DetailModel, 0.1.json
  • DetailModel, 0.2.json

But I get an error in xConnect and the IndexWorker regarding: different models with the same names are referenced.

2019-03-11 12:08:56.970 +01:00 [Error] Exception occurred during instantiating of IndexerHost.
Sitecore.XConnect.Schema.DuplicateXdbModelNameException: Different models with the same names are referenced ('DetailModel')
   at Sitecore.XConnect.Schema.XdbModel.AddAndValidateModelAndTypes(XdbModel model, HashSet`1 visited)
   at Sitecore.XConnect.Schema.XdbModel.AddAndValidateModelAndTypes(XdbModel model, HashSet`1 visited)
   at Sitecore.XConnect.Schema.XdbModel..ctor(String name, XdbModelVersion version, XdbNamedType[] types, XdbFacetDefinition[] facets, XdbModel[] referencedModels)
   at Sitecore.XConnect.Schema.XdbRuntimeModel..ctor(XdbModel[] models)
   at Sitecore.XConnect.Search.Indexer.Extensions.UseXConnectModel(IServiceCollection services, DirectoryInfo modelsPath)
   at Sitecore.XConnect.Search.Indexer.IndexerHost.GetDiServiceProvider(IConfiguration config, String modelDirectory, EventHandler configOrModelChangedHandler)
   at Sitecore.XConnect.Search.Indexer.IndexerHost..ctor(IConfigurationRoot config)
   at Sitecore.XConnect.Search.Indexer.IndexerAppDomainHost.IndexerHostAppDomainBridge..ctor()

Why am I getting this error? I would assume that it is possible to have multiple versions deployed.

3

Even though it seems confusing at first, but different XConnect model version does not make model unique only model name does. Model versions can be used for your own sake to keep track of different model versions. However, XConnect cannot handle two or more versions of the same model. On a related note, all referenced models have to have unique names as well (see the last section in Sitecore documentation:

Model names must be unique across all referenced models, including second order references. For example:

A model named CRM.Model cannot reference another model named CRM.Model

A model named CRM.Model cannot reference Documentation.Model which in turn references another model named CRM.Model

A DuplicateModelNameException exception is thrown if model names are not unique.

  • Ok, I understand how it works better now. Removing the 'old' DetailModel, 0.1.json xConnect and the IndexWorker solved the error. – Koen Heye Mar 11 at 16:02

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.