Entry with the same key already exists

amartin575
New Contributor II

Hello,

I am receiving the error "Entry with the same key already exists" when trying to load a xml through a workflow. I have checked all of the dimensions, transformation rules, data sources, etc. and am not finding any duplication. Looking online I see recommendations on other platforms where the issue relates to a ListDictionary and Add within the code where it tries to add something that may already exist?  I am curious if anyone has ran across this issue and how you resolved it.

 

Summary: An entry with the same key already exists.   
---------------------------------------- 
Description: An entry with the same key already exists. 
Error Time: 3/3/2023 10:03:03 PM 
Error Level: 
Error Tier: AppServer 
App Server XF Version: 6.8.1.13230 
App Server OS Version: Microsoft Windows NT 10.0.14393.0   
Total Memory: 68,719,005,696 (64.00 GB) Memory In Use: 1,979,629,568 (1.84 GB) Private Memory In Use: 2,175,569,920 (2.03 GB) Peak Memory In Use: 2,666,090,496 (2.48 GB) Maximum Data Records In RAM: 12,884,813 
Maximum Data Units In RAM: 100,000 
Number Of Threads: 81   
---------------------------------------- 
Exception Type: XFException Thread Id: 58 Source code: Transformer.vb, line 1588, method ParseAndTransform   
---------------------------------------- 
Exception Type: XFException Thread Id: 58 Source code: Transformer.vb, line 852, method InitializeTransformer   
---------------------------------------- 
Exception Type: XFException Thread Id: 58 Source code: Transformer.vb, line 1105, method InitializeDataCache   
---------------------------------------- 
Exception Type: XFException Thread Id: 58 Source code: Transformer.vb, line 1031, method InitializeDimensionListCache   Stack Trace:    at OneStream.Stage.Engine.Transformer.InitializeDimensionListCache(SessionInfo si, String cubeName, Int32 scenarioTypeID, TransformDataCache dataCache) in C:\agent\_work\298\s\Source\Stage\StageEngine\Transformer\TransformerEngine\Transformer.vb:line 1031    at OneStream.Stage.Engine.Transformer.InitializeDataCache(SessionInfo si, WorkflowUnitClusterPk wfClusterPk, Int32 DataPageSize, Int32 PagesInMemoryLimit) in C:\agent\_work\298\s\Source\Stage\StageEngine\Transformer\TransformerEngine\Transformer.vb:line 1105    at OneStream.Stage.Engine.Transformer.InitializeTransformer(SessionInfo si, WorkflowUnitPk wfUnitPk, String sourceFilePath, Boolean retransformingOnly, TaskActivityStepWrapperItem parentTaskActivityStep) in C:\agent\_work\298\s\Source\Stage\StageEngine\Transformer\TransformerEngine\Transformer.vb:line 852    at OneStream.Stage.Engine.Transformer.ParseAndTransform(SessionInfo si, WorkflowUnitPk wfUnitPk, String sourceFilePath, TransformLoadMethodTypes loadMethod, Boolean deleteFilesFromOSAfterArchiving, Guid taskActivityID) in C:\agent\_work\298\s\Source\Stage\StageEngine\Transformer\TransformerEngine\Transformer.vb:line 1588    at OneStream.Stage.Engine.ParseAndTransformThread.WorkerThreadMethod() in C:\agent\_work\298\s\Source\Stage\StageEngine\Transformer\TransformerEngine\ParseAndTransformThread.vb:line 85   
---------------------------------------- 
Exception Type: Unknown Message: An entry with the same key already exists.   Stack Trace:    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)    at System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)    at System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)    at OneStream.Stage.Engine.Transformer.InitializeDimensionListCache(SessionInfo si, String cubeName, Int32 scenarioTypeID, TransformDataCache dataCache) in C:\agent\_work\298\s\Source\Stage\StageEngine\Transformer\TransformerEngine\Transformer.vb:line 1031

 

3 REPLIES 3

JackLacava
Honored Contributor

Yes, that's a generic VB.Net error that is thrown when you try to add a key to a Dictionary that already contains it. To say more, you'd have to provide some detail on what you mean by "loading a xml through a workflow". Chances are you're manipulating a dictionary somehow and repeating keys without realizing.

adykes
New Contributor III

I'm not sure if this will help considering this thread is about three months old, but I came across it as I was trying to solve this error as well. Specifically, I was encountering this error when trying to load an Excel file as a form import template. I was able to resolve it by making sure all of my named ranges in the Excel file were still valid and referred to cell ranges. 

alesage
New Contributor III

This error can also happen if the Integration settings are not defined properly for the current scenario type being imported. Typically, if several dimensions have the same transformation sequence number, the import of the files will fail and this error will be shown.  

For instance, this kind of setting is inappropriate for the cube integration settings: 

- Attribute1 = 50
- Attribute2 = 50