azure-devops-migration-tools icon indicating copy to clipboard operation
azure-devops-migration-tools copied to clipboard

An item with the same key has already been added

Open MrHinsh opened this issue 1 year ago • 1 comments

Got this error while migrating WI's. Can anyone help resolve this issue?

System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable1 source, Func2 keySelector) at MigrationTools.Endpoints.TfsWorkItemConvertor.GetRevisionItems(RevisionCollection tfsRevisions) in D:\a\azure-devops-migration-tools\azure-devops-migration-tools\src\MigrationTools.Clients.AzureDevops.ObjectModel\Endpoints\TfsWorkItemConvertor.cs:line 73 at MigrationTools.Endpoints.TfsWorkItemConvertor.MapWorkItemtoWorkItemData(WorkItemData context_wid, WorkItem context_wi, Dictionary2 fieldsOfRevision) in D:\a\azure-devops-migration-tools\azure-devops-migration-tools\src\MigrationTools.Clients.AzureDevops.ObjectModel\Endpoints\TfsWorkItemConvertor.cs:line 39 at MigrationTools.TfsExtensions.RefreshWorkItem(WorkItemData context, Dictionary2 fieldsOfRevision) in D:\a\azure-devops-migration-tools\azure-devops-migration-tools\src\MigrationTools.Clients.AzureDevops.ObjectModel\TfsExtensions.cs:line 51 at MigrationTools.TfsExtensions.SaveToAzureDevOps(WorkItemData context) in D:\a\azure-devops-migration-tools\azure-devops-migration-tools\src\MigrationTools.Clients.AzureDevops.ObjectModel\TfsExtensions.cs:line 87 at VstsSyncMigrator.Engine.WorkItemMigrationContext.ReplayRevisions(List1 revisionsToMigrate, WorkItemData sourceWorkItem, WorkItemData targetWorkItem) in D:\a\azure-devops-migration-tools\azure-devops-migration-tools\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 871

Originally posted by @akurisummoottil in https://github.com/nkdAgility/azure-devops-migration-tools/discussions/2336



Funding for us doing work on this tool is generally through 1) customer funding, or 2) donated free time.

Sponcer a Feature | Hire us directly

MrHinsh avatar Sep 06 '24 21:09 MrHinsh

I ran into the same error with the following logs when migration 190 work items:

migration-errors.log migration.log

It looks like it an intermittent issue or some sort of race condition. Running arain with a failing workitem resulted in a success as in:

migration.log migration-errors.log

Very strange behaviours and worth investigtaing.

MrHinsh avatar Sep 06 '24 21:09 MrHinsh

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days

github-actions[bot] avatar Jan 16 '25 00:01 github-actions[bot]