8

We're intermittently getting this error when fetching source from TFS:

2017-03-23T23:49:31.0591599Z ##[section]Starting: Build solution [SOLUTION-NAME].sln
2017-03-23T23:49:31.0591599Z ==============================================================================
2017-03-23T23:49:31.0591599Z Task         : Visual Studio Build
2017-03-23T23:49:31.0591599Z Description  : Build with MSBuild and set the Visual Studio version property
2017-03-23T23:49:31.0591599Z Version      : 1.113.0
2017-03-23T23:49:31.0591599Z Author       : Microsoft Corporation
2017-03-23T23:49:31.0591599Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613727)
2017-03-23T23:49:31.0591599Z ==============================================================================
2017-03-23T23:49:31.6529233Z Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.
2017-03-23T23:49:31.8872843Z ##[error]Exit code 100 returned from process: file name 'tf', arguments 'vc resolvePath "$\My Development\Trunk\src\Rostering\trunk\[SOLUTION-NAME].sln" /loginType:OAuth /login:.,******** /noprompt'.

Any idea what causes this issue? We see no clear pattern when this happens. Our build server runs 24/7. It appears more likely to happen on the first build of the day.

Quality Catalyst
  • 6,531
  • 8
  • 38
  • 62
  • Adding as a comment because this isn't a solution/fix -- This occurred on a server I was using due to a network issue, and after re-running the build, the error did not occur. – ryanwebjackson Sep 24 '18 at 20:13
  • We have had the same experience hence this post: the problem only occurred only intermittently. – Quality Catalyst Sep 24 '18 at 20:14

3 Answers3

4

The issue may related to the workspace, you could give a try with solution Error When Setting Clean = True on Windows

Looks like scorch is failing when the root sources folder (e.g. _work\1\s) is not mapped - i.e. workspace does not contain a root mapping. One not great workaround is to set a variable build.clean to all.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thank you! We'll give this a go yet the downside is that we've got loads of builds and this slows down their time consumption severely. I'd rather prefer a solution for the problem. Why wouldn't the root folder been mapped intermittently? How can this be fixed? – Quality Catalyst Apr 06 '17 at 02:54
  • @QualityCatalyst If you set the parameter *Clean build* to **False** for faster performance. This setting might cause your team to miss some types of defects, such as those introduced during refactoring. It may lose the mapping, just like the error indicate `Unable to determine the workspace. ` Usually retrigger the build will fix the issue. – PatrickLu-MSFT Apr 06 '17 at 04:34
  • The retriggering build is not fixing the issue for me. – Darshana Patel Sep 24 '19 at 05:24
2

Create a mapping for the root as $/projectroot/* and keep the Local path field blank. This will only download single level folders as empty below the project root. This is a workaround.

1

On your tfs build agent, you can delete cache files on $/{agentfolder}/_work/SourceRootMapping. It happens me when i changed build server of collection.

adiga
  • 34,372
  • 9
  • 61
  • 83
Emel E.
  • 7
  • 3