Skip to content

[Bug]: Using TfsEmbededImagesTool fails with certain process template configurations #2484

Description

@FlexiGit

Version

  • I confirm that I am using the latest version

Source Version

Azure DevOps Service

Target Version

Azure DevOps Service

Relevant configuration

No response

Relevant log output

[16:02:47 ERR] [16.0.6] EmbededImagesRepairEnricher: Unable to fix HTML field attachments for work item *** from *** to ***
Microsoft.TeamFoundation.WorkItemTracking.WebApi.RuleValidationException: TF401320: Rule Error for field ***. Error code: Required, HasValues, AllowsOldValue, InvalidEmpty.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__47`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__28`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at MigrationTools.Tools.TfsEmbededImagesTool.UploadImageToTarget(WorkItem wi, String filePath) in C:\GitRepos\azure-devops-migration-tools\src\MigrationTools.Clients.TfsObjectModel\Tools\TfsEmbededImagesTool.cs:line 199
   at MigrationTools.Tools.TfsEmbededImagesTool.UploadedAndRetrieveAttachmentLinkUrl(String matchedSourceUri, String sourceFieldName, WorkItemData targetWorkItem, String sourcePersonalAccessToken) in C:\GitRepos\azure-devops-migration-tools\src\MigrationTools.Clients.TfsObjectModel\Tools\TfsEmbededImagesTool.cs:line 153
   at MigrationTools.Tools.TfsEmbededImagesTool.FixEmbededImages(WorkItemData wi, String oldTfsurl, String newTfsurl, String sourcePersonalAccessToken) in C:\GitRepos\azure-devops-migration-tools\src\MigrationTools.Clients.TfsObjectModel\Tools\TfsEmbededImagesTool.cs:line 93

What happened?

Running a pretty minimal config with one of our projects, the above stacktrace appears many times in the logs.

Looking at the code, there should be an easy fix, though.

In MigrationTools.Tools.TfsEmbededImagesTool.UploadImageToTarget(WorkItem wi, String filePath) in C:\GitRepos\azure-devops-migration-tools\src\MigrationTools.Clients.TfsObjectModel\Tools\TfsEmbededImagesTool.cs:line 199
you could use the bypassRules = true optional parameter, also in line 205.

Debug in Visual Studio

  • Visual Studio Debug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions