When I start "MongoDB Contacts to xConnect Migration" pipeline with 1 thread all works fine. But when start with more then 1. I have an error after random count of processed contacts.

24104 14:15:53 ERROR [Data Exchange] Collection was modified; enumeration operation may not execute. (pipeline: Read Contacts from MongoDB Pipeline, pipeline step: Iterate MongoDB Contacts and Run Pipelines, pipeline step identifier: 4d6400a4-4e78-4555-80d7-46aafd07afe9)
24104 14:15:53 ERROR [Data Exchange] at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Sitecore.DataExchange.Processors.PipelineSteps.BasePipelineStepProcessor.GetMissingRequiredPlugin[T](IHasPlugins obj)
   at Sitecore.DataExchange.Processors.PipelineSteps.BasePipelineStepProcessor.AreRequiredPluginsSet()
   at Sitecore.DataExchange.Processors.PipelineSteps.BasePipelineStepProcessor.StartProcessing(PipelineStep pipelineStep, PipelineContext pipelineContext, ILogger logger)
   at Sitecore.DataExchange.Processors.Pipelines.PipelineProcessor.ProcessPipelineStep(PipelineStep pipelineStep, PipelineContext pipelineContext, ILogger logger)
   at Sitecore.DataExchange.Processors.Pipelines.PipelineProcessor.ProcessPipeline(Pipeline pipeline, PipelineContext pipelineContext, ILogger logger)
   at Sitecore.DataExchange.Processors.PipelineSteps.IterateAndRunPipelinesStepProcessor.ProcessPipelines(PipelineStep pipelineStep, ICollection`1 subPipelines, PipelineContext pipelineContext, ILogger logger)
   at Sitecore.DataExchange.Processors.PipelineSteps.IterateAndRunPipelinesStepProcessor.<>c__DisplayClass4_0.<IterateWithThreads>b__0(Object element, Int32 threadId)
   at Sitecore.DataExchange.Helpers.EnumeratorHandlerHelper.RunThread(IEnumerator data, Int32 threadId, EnumeratorHandlerHelperContext context)

Does someone know what i configured wrong?

  • Which pipeline step was used to set threads? – Vlad Shpak Mar 4 '19 at 22:30
  • @VladShpak this "Iterate MongoDB Contacts and Run Pipelines" – pblrok Mar 5 '19 at 8:39

This issue is with the product itself, not related to the configuration.

BaseHasPlugins class is not a thread-safe. Basically, it holds the list of plugins associated with some pipeline-step (in this case).

When you are running it with multiple threads: while one thread is using the method public IPlugin GetPlugin(Type type) which enumerates over a list of internal plugins, another thread is trying to add/modify a new plugin.

Please contact Sitecore Support to resolve it.

Workaround: You can inherit the current pipeline step processor, and override

protected override bool AreRequiredPluginsSet() { return true; }

| improve this answer | |

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.