Skip to content

System.IndexOutOfRangeException when cretaing links with CreateFromGit #3069

@MrHinsh

Description

@MrHinsh

Discussed in #3068

Originally posted by ptc-96 November 21, 2025
Hello,

I am performing a migration and I have encountered an error while migrating git links.

{"Timestamp":"2025-11-20T13:14:26.7544653+01:00","Level":"Error","MessageTemplate":"Sy**stem.IndexOutOfRangeException: Index was outside the bounds of the array.** \r\n   
at MigrationTools.Tools.TfsGitRepositoryInfo.CreateFromGit(ExternalLink gitExternalLink, IList 1 possibleRepos) in D:\\a\\azure-devops-migration-tools\\azure-devops-migration-tools\\src\\MigrationTools.Clients.TfsObjectModel\\Tools\\TfsGitRepositoryInfo.cs:line 97\r\n   
at MigrationTools.Tools.TfsGitRepositoryInfo.Create(ExternalLink gitExternalLink, IList 1 possibleRepos, TfsChangeSetMappingTool tfsChangeSetMappingTool, String workItemSourceProjectName) in D:\\a\\azure-devops-migration-tools\\azure-devops-migration-tools\\src\\MigrationTools.Clients.TfsObjectModel\\Tools\\TfsGitRepositoryInfo.cs:line 31\r\n   
at MigrationTools.Tools.TfsGitRepositoryTool.Enrich(TfsProcessor processor, WorkItemData sourceWorkItem, WorkItemData targetWorkItem) in D:\\a\\azure-devops-migration-tools\\azure-devops-migration-tools\\src\\MigrationTools.Clients.TfsObjectModel\\Tools\\TfsGitRepositoryTool.cs:line 109\r\n   
at MigrationTools.Processors.TfsWorkItemMigrationProcessor.ProcessWorkItemLinks(WorkItemData sourceWorkItem, WorkItemData targetWorkItem) in D:\\a\\azure-devops-migration-tools\\azure-devops-migration-tools\\src\\MigrationTools.Clients.TfsObjectModel\\Processors\\TfsWorkItemMigrationProcessor.cs:line 686\r\n   
at MigrationTools.Processors.TfsWorkItemMigrationProcessor.<ProcessWorkItemAsync>d__31.MoveNext() in D:\\a\\azure-devops-migration-tools\\azure-devops-migration-tools\\src\\MigrationTools.Clients.TfsObjectModel\\Processors\\TfsWorkItemMigrationProcessor.cs:line 581",

I've checked that some of the LinkedArtifactUri values of the Git links are not in the expected legacy format:
vstfs:///Git/Commit/_repoId_**%2f**_commitId_
but instead use the newer Azure DevOps format:
vstfs:///Git/Commit/_projectName_/_repoName_/_commitId_

This causes the tool to fail when trying to parse and construct the Git link.
<img width="1502" height="223" alt="image" src="https://github.com/user-attachments/assets/07489056-8b5b-43d2-b005-703ae0204580" />

Suggestion:
If supporting the new URI formats is not possible at this time, would it be feasible to at least catch this exception so the migration process does not stop entirely?

Thanks!

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions