1

I have TFS2018 server and a separate build server. When I try to build I get the following error during the get sources step:

Exit code 100 returned from process: file name 'tf', arguments 'vc workspace /new /location:local /permission:Public ws_1_1 /collection:https://mydevtfs/tfs/DefaultCollection/ /loginType:OAuth /login:.,****** /noprompt'.

The root mapping looks like this. But all subfolders inside MyProjectFolder are empty. Any idea how to specify the path so the files will be included within the subfolders as well?

enter image description here

Here is a screenshot of the last part of the log

enter image description here

doorman
  • 15,707
  • 22
  • 80
  • 145

1 Answers1

1

The issue may related to the workspace mapping, doulce check the source mapping of your build definition. 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.

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


update

enter image description here

enter image description here

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thanks @PatrickLu-MSFT the problem was related to this https://stackoverflow.com/questions/226288/team-build-error-the-path-is-already-mapped-to-workspace – doorman Nov 22 '17 at 09:34
  • @doorman Seems the issue is still related to the workspace mapping. Thanks for the sharing, especially this part `It's important to map root of your collection to your workspace first and then map a new project.` yes, some path issue may caused if this step was skipped. – PatrickLu-MSFT Nov 22 '17 at 09:44
  • Hi @PatrickLu-MSFT hoping you can assist me a litle more before I give you the correct answer :) . See the updated question with a picture of the root mapping. The problem is the subfolders are all empty. I also tried leaving the local path empty but then the contents of MyProjectFolder is put directly on the root. – doorman Nov 22 '17 at 11:52
  • @doorman Could you try to directly use`$/MyFirstParentFolder/MyProjectFolder` instead of using `/*`, `*` will just copies all files in the root folder. – PatrickLu-MSFT Nov 22 '17 at 12:08
  • Yes, this works but then I get the error Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:58632 /recursive /overwrite C:\agent\_work\1\s /loginType:OAuth /login:.,******** /noprompt'. Microsoft.VisualStudio.Services.Agent.ProcessExitCodeException: Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:58632 /recursive /overwrite C:\agent\_work\1\s /loginType:OAuth /login:.,******** /noprompt'. – doorman Nov 22 '17 at 12:10
  • During get sources – doorman Nov 22 '17 at 12:10
  • @doorman Really wired, could not reproduce your issue in my side. Afraid there are some folders already in the build agent, try to set `clean=true` in the get source and try it again... – PatrickLu-MSFT Nov 22 '17 at 12:19
  • @doorman If this still not work, suggest you reconfigure your build agent and try it agian. For the repository mapping you could have a look at this [tutorial](https://learn.microsoft.com/en-us/vsts/build-release/concepts/definitions/build/repository#tfvc-options) in MSDN – PatrickLu-MSFT Nov 22 '17 at 12:22
  • @doorman Another way like my answered mentioned, keep `$/MyFirstParentFolder/MyProjectFolder` in the map list, and add a **new** map with `$/MyFirstParentFolder/*` , keep local path filed blank. This should also do the trick. – PatrickLu-MSFT Nov 22 '17 at 12:59
  • Hi @PatrcikLu-MSFT thanks for your quick reply. I tried setting the new map as well but then the build only run's for 0 seconds. It fails but I only see the Build details page not really the error. I will try and reconfigure the build and see if it helps – doorman Nov 22 '17 at 14:11
  • Unfortunately reconfiguring the agent didn't work I still get the error: Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:58632 /recursive /overwrite C:\a\w\1\s /loginType:OAuth /login:.,******** /noprompt'. – doorman Nov 22 '17 at 14:23
  • @doorman which build agent version are you using? I'm on the latest [v2.125.1](https://github.com/Microsoft/vsts-agent/releases) with TFS 2018, make sure you also have set `clean=true`, have add my screenshot of the get source page for your reference. Suggest you create a new build definition and another test project for test. If it works well, there maybe some **mapping issue** in your specific project. – PatrickLu-MSFT Nov 22 '17 at 17:22
  • Hi @PatrickLu-MSFT thanks alot for your help. I updated to the same agent version as you have but I still get the same error. Please see the attached screenshot of the log. From the summary it finds two errors. I wonder if they are related to the two "Tha path contains more than the allowed 259 chars" If I try to search for error it only finds filenames containing error in the name. – doorman Nov 23 '17 at 09:32
  • 1
    Hi @PatrickLu-MSFT I cloaked the projects (UnitTest projects) that where generating the 259 chars bug and now I am past the error :) So now I got as far as the Nuget restore step, I need to deal with a few bugs there. Do you know is the only way to ignore the 259 chars error by cloaking the projects? – doorman Nov 23 '17 at 09:47
  • 1
    @doorman According to your entire log info and the previous issue description. I guess the root cause is still the long path issue(more than 259) since if you use `$/MyFirstParentFolder/MyProjectFolder/*` this will ignore the files in subfolder, so the path will not be too long and your build for get resource task passed. Cloaked the too long path projects which generated the error is a solution. If you want to include the projects in your build source directory, another way is tweaking the project path on TFS source control system. There is not any other workaround. – PatrickLu-MSFT Nov 23 '17 at 10:02