0

I was trying to migrate tfs to git using git tfs clone command:

git tfs clone https://locahost/collection $/"Test project/feature-branch"

Error received:

2019-10-31 12:39:56.8412 [Debug] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> There was an error generating the XML document. ---> Specified cast is not valid. at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.LoadWorkItem(Int32 id, Int32 rev, Nullable1 asof, IWorkItemRowSets& witem) at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem..ctor(WorkItemStore store, Uri uri) at Microsoft.TeamFoundation.VersionControl.Client.Changeset.get_WorkItems() at GitTfs.VsCommon.TfsHelperBase.BuildTfsChangeset(Changeset changeset, IGitTfsRemote remote) at GitTfs.VsCommon.TfsHelperBase.<GetChangesets>d__46.MoveNext() at GitTfs.Core.GitTfsRemote.FetchWithMerge(Int32 mergeChangesetId, Boolean stopOnFailMergeCommit, Int32 lastChangesetIdToFetch, IRenameResult renameResult, String[] parentCommitsHashes) at GitTfs.Core.GitTfsRemote.Fetch(Boolean stopOnFailMergeCommit, Int32 lastChangesetIdToFetch, IRenameResult renameResult) at GitTfs.Commands.Fetch.DoFetch(IGitTfsRemote remote, Boolean stopOnFailMergeCommit) at GitTfs.Commands.Fetch.FetchRemote(Boolean stopOnFailMergeCommit, IGitTfsRemote remote) at GitTfs.Commands.Fetch.Run(Boolean stopOnFailMergeCommit, String[] args) at GitTfs.Commands.Fetch.Run() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at GitTfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList
1 args) at GitTfs.GitTfs.Main(GitTfsCommand command, IList1 unparsedArgs) at GitTfs.GitTfs.Run(IList1 args) at GitTfs.Program.Main(String[] args)

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Uday
  • 151
  • 1
  • 3
  • 15
  • Hi Uday, Did you get a chance to implement the solution that Daniel suggested? Were you able to resolve? – PatrickLu-MSFT Nov 01 '19 at 10:03
  • Hi Patrick, it migrates around 180k changeset and then it gets stuck at a certain changeset with the above error – Uday Nov 07 '19 at 09:44

1 Answers1

1

It looks like you have a typo:

$/"Test project/feature-branch"

You should wrap the entire source control path in quotation marks: "$/Test project/feature-branch"

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • Hi Daniel, it migrates around 180k changeset and then it gets stuck at a single changeset with the above error – Uday Nov 06 '19 at 05:27
  • Yes, I tried wrapping sourcepath in double-quotes. but, it's failing. – Uday Dec 18 '19 at 13:30