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

unable to read the migration query #29

Closed bfbatch closed 5 years ago

bfbatch commented 6 years ago

Hi,

Getting the above error when running the tool. I left the default value in the query section. I have Project Collections Admin on both sides. From config "query": "Shared Queries/Website/All Tasks" I also changed the values in the query, and pulled latest. Am I missing something? Here is the error from the log

[Error @14.12.34.428] Validation error: Common.Validation.ValidationException: Unable to read the migration query ---> Common.RetryPermanentException: Permanent error for ba8bb07e-fce6-4485-896d-7ebbe5550bbf, not retrying ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TF401243: The query Shared Queries/Website/All Tasks does not exist, or you do not have permission to read it.

ernonewman commented 6 years ago

I'm running into the same issue and can't figure out the issue.

The query is definately present in TFS and I have the requried permissions but for some reason it fails.

bfbatch commented 6 years ago

I was able to get mine to work by adding a query to My Queries. I was not able to work with anything under Shared Queries. Hope that helps.

ernonewman commented 6 years ago

I originally had mine under My Queries but moved it to shared when that didn't work but I will try again,

Thanks.

vinicius-stutz commented 6 years ago

@ernonewman, Did you ever find a solution?

ernonewman commented 6 years ago

@vinicius-stutz, no, unfortunately not

vinicius-stutz commented 6 years ago

@ernonewman What version of TFS are you using?

ernonewman commented 6 years ago

2017, we just decided to move pass it the hard way, at the end of a sprint, stop dev in old project, archive it and manually copy remaining tickets to new project, deadlines sometimes call the shots 😁

vinicius-stutz commented 6 years ago

@ernonewman :'(

vkalokhe12 commented 6 years ago

I'm running into the same issue and can't figure out the issue. I have tried with Shared & My Query still no luck, (TFS version 2018)

obvioussean commented 5 years ago

Could you please attach your logs?

irzum commented 5 years ago

well i never faced this problem, you have to give the path of your query respectively, if it is in My Queries you have to put "My Queries/your query name"

if you query is in SHARED queries then you have to put "Shared Queries/your query name"

in file

abx78 commented 5 years ago

I run in the same issue, this is the error I get from the log:

`[Info @08.34.57.323] Getting query for tfsmachinename [Error @08.34.57.516] Validation error: Common.Validation.ValidationException: Unable to read the migration query ---> Common.RetryPermanentException: Permanent error for f3e19c51-ec5e-4729-941a-b7542c3489d3, not retrying

---> Microsoft.VisualStudio.Services.WebApi.VssResourceNotFoundException: API resource location a67d190c-c41f-424b-814d-0e906f659301 is not registered on http://tfsmachinename:8080/tfs. at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__33.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.d__27`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 Common.WorkItemTrackingHelpers.<>c__DisplayClass6_0.<b__0>d.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\WorkItemTrackingHelpers.cs:line 55

--- 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.TaskAwaiter1.GetResult() at Common.RetryHelper.<RetryAsync>d__41.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\RetryHelper.cs:line 31

--- End of inner exception stack trace --- at Common.RetryHelper.d__4`1.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\RetryHelper.cs:line 78

--- 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.TaskAwaiter1.GetResult() at Common.RetryHelper.<RetryAsync>d__31.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\RetryHelper.cs:line 18

--- 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 Common.Validation.ValidateSourceQuery.d__6.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Configuration\ValidateSourceQuery.cs:line 29

--- End of inner exception stack trace --- at Common.Validation.ValidateSourceQuery.d__6.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Configuration\ValidateSourceQuery.cs:line 33

--- 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 Common.Validation.ValidateSourceQuery.d__5.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Configuration\ValidateSourceQuery.cs:line 19

--- 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 Common.Validation.Validator.d__6.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Validator.cs:line 104

--- 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 Common.Validation.Validator.d__5.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Validator.cs:line 26

--- 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 WiMigrator.CommandLine.d__8.MoveNext() in C:\Temp\vsts-work-item-migrator-master\WiMigrator\CommandLine.cs:line 84

[Info @08.34.57.521] Summary of errors and warnings: [Error @08.34.57.525] Validation error:. Unable to read the migration query. Unable to read the migration query`

irzum commented 5 years ago

I run in the same issue, this is the error I get from the log:

`[Info @08.34.57.323] Getting query for tfsmachinename [Error @08.34.57.516] Validation error: Common.Validation.ValidationException: Unable to read the migration query ---> Common.RetryPermanentException: Permanent error for f3e19c51-ec5e-4729-941a-b7542c3489d3, not retrying

---> Microsoft.VisualStudio.Services.WebApi.VssResourceNotFoundException: API resource location a67d190c-c41f-424b-814d-0e906f659301 is not registered on http://tfsmachinename:8080/tfs. at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__33.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.d__27`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 Common.WorkItemTrackingHelpers.<>c__DisplayClass6_0.d.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\WorkItemTrackingHelpers.cs:line 55

--- 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.TaskAwaiter1.GetResult() at Common.RetryHelper.<RetryAsync>d__41.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\RetryHelper.cs:line 31

--- End of inner exception stack trace --- at Common.RetryHelper.d__4`1.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\RetryHelper.cs:line 78

--- 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.TaskAwaiter1.GetResult() at Common.RetryHelper.<RetryAsync>d__31.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\RetryHelper.cs:line 18

--- 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 Common.Validation.ValidateSourceQuery.d__6.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Configuration\ValidateSourceQuery.cs:line 29

--- End of inner exception stack trace --- at Common.Validation.ValidateSourceQuery.d__6.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Configuration\ValidateSourceQuery.cs:line 33

--- 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 Common.Validation.ValidateSourceQuery.d__5.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Configuration\ValidateSourceQuery.cs:line 19

--- 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 Common.Validation.Validator.d__6.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Validator.cs:line 104

--- 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 Common.Validation.Validator.d__5.MoveNext() in C:\Temp\vsts-work-item-migrator-master\Common\Validation\Validator.cs:line 26

--- 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 WiMigrator.CommandLine.d__8.MoveNext() in C:\Temp\vsts-work-item-migrator-master\WiMigrator\CommandLine.cs:line 84

[Info @08.34.57.521] Summary of errors and warnings: [Error @08.34.57.525] Validation error:. Unable to read the migration query. Unable to read the migration query`

you are not giving correct migration query name

in config file you have to change the QUERY property which is something like this "Shared Queries/your query name" if you are using a query which is in "My Query" then you have to put "My Queries/your query name" in query property if you are using a query which is in shared folder then you have to give "Shared Queries/your query name"

abx78 commented 5 years ago

At the moment my configuration says: "query": "Shared Queries/MyProject/MyMigrationQuery"

Can't spot an issue with that...

irzum commented 5 years ago

At the moment my configuration says: "query": "Shared Queries/MyProject/MyMigrationQuery"

Can't spot an issue with that...

yes now what you are going to do is something like this steps 1)remove this part "Shared Queries/MyProject/MyMigrationQuery" 2)check if your query is in "My Queries" folder or in "Shared Queries" 3)if you query is in "My Query" then put " "query": My Queries/YourQueryName" else " "query": Shared Queries/YourQueryname"

abx78 commented 5 years ago

Thanks for helping out @irzum The error unfortunately persists.

Debugging the code, I see the exception is raised when trying to get the query with the command:

client.GetQueryAsync(project, queryName, QueryExpand.Wiql)

I have the same issue if I run this command: client.GetQueriesAsync("MyProject")

API resource location a67d190c-c41f-424b-814d-0e906f659301 is not registered on http://tfsmachinename/tfs.

abx78 commented 5 years ago

If I decompile the code behind GetQueriesAsync and GetQueryAsync from the Microsoft.TeamFoundation.WorkItemTracking.WebApi I see a locationId variable is instantiated with the following value:

Guid locationId = new Guid("a67d190c-c41f-424b-814d-0e906f659301");

This suspiciously matches what is shown in the error I am getting...

irzum commented 5 years ago

you are trying to migrate data from either one vsts/tfs right?

obvioussean commented 5 years ago

Could you share a screenshot of your all queries list on your project? It is unusual to have project in the path for your shared queries.

What version of TFS are you migrating from?

abx78 commented 5 years ago

you are trying to migrate data from either one vsts/tfs right?

Yes, moving out of TFS 2015

Could you share a screenshot of your all queries list on your project? It is unusual to have project in the path for your shared queries.

What version of TFS are you migrating from?

TFS 2015. Also, I get the same issue if I move the query in the root of the Shared Queries

irzum commented 5 years ago

you can use command line to do the migration using the -validate and -migrate command

obvioussean commented 5 years ago

@abx78 That's your problem. The migrator only supports TFS 2017 or higher, TFS 2015 doesn't have the necessary REST APIs.

abx78 commented 5 years ago

Ha, that makes sense, unfortunately. Thanks a lot for your help @obvioussean