microsoft / vsts-work-item-migrator

WiMigrator is a command line tool for migrating work items between VSTS/TFS projects
MIT License
148 stars 69 forks source link

Error uploading attachments of different file types #49

Closed pelvark closed 5 years ago

pelvark commented 5 years ago

I'm running the migrator from one project on VSTS to another project on another organizations VSTS. The validation phase runs fine, the migration phase has a ton of critical errors. Almost all of them looks something like the following:

[Error   @14.37.26.992] Unable to upload attachment front end validation.mov for source work item 90389 to the target account
System.Net.Http.UnsupportedMediaTypeException: No MediaTypeFormatter is available to read an object of type 'ExceptionResponse' from content with media type 'text/html'.
   at Common.RetryHelper.RetryAsync[T](Func`1 function, Func`3 exceptionHandler, Int32 retryCount, Int32 secsDelay) in C:\Users\jkc\Downloads\vsts-work-item-migrator\Common\RetryHelper.cs:line 78
   at Common.RetryHelper.RetryAsync[T](Func`1 function, Int32 retryCount, Int32 secsDelay) in C:\Users\jkc\Downloads\vsts-work-item-migrator\Common\RetryHelper.cs:line 18
   at Common.WorkItemTrackingHelpers.CreateAttachmentChunkedAsync(WorkItemTrackingHttpClient client, VssConnection connection, MemoryStream uploadStream, Int32 chunkSizeInBytes) in C:\Users\jkc\Downloads\vsts-work-item-migrator\Common\WorkItemTrackingHelpers.cs:line 131
   at Common.Migration.AttachmentsProcessor.UploadAttachmentFromSourceRelation(IMigrationContext migrationContext, IBatchMigrationContext batchContext, WorkItem sourceWorkItem, WorkItemRelation sourceRelation, Int32 maxAttachmentSize) in C:\Users\jkc\Downloads\vsts-work-item-migrator\Common\Migration\Phase2\Processors\AttachmentsProcessor.cs:line 184

I've checked and it happens regardless of the size of the attachment. It seems text files work fine, but all files that are pictures/movies/excel files give this error.

Is there anything I can do?

pelvark commented 5 years ago

The solution was following the tip in the iddue: "Account Uri requires trailing '/'"

I added a "/" to the end of my target destination in the configuration file.