1
votes

For some reason my build definition are not working properly if long path mappings. If I were using the path $/Project/Samples it works OK.

My build has this in the repository tab: enter image description here

Then the logs show that there is no SLN found, and I confirmed that nothing was downloaded to the agent working folders: enter image description here

For me it's a bug when getting sources, as I can't see a good why it is not getting correctly the files. I already tried to add files in some folders above and it works. Some ideas?

3
Can you share your folder structure and the logs of "Get sources" step?Eddie Chen - MSFT
There are only 4 entries in the get sources, may it be realated to long paths? 2016-07-22T21:33:19.7439002Z Syncing repository: GLB-NVS (TFVC) 2016-07-22T21:33:20.9638996Z Workspace Name: ws_1_11;Build\b26b6b35-d3d7-44c8-b4f1-c358c87a8356 2016-07-22T21:33:21.0729012Z tf get /version:C528101 2016-07-22T21:38:22.4865285Z Done syncing repository GLB-NVS to version C528101 (workspace version -1)Fabito

3 Answers

4
votes

This permissions issue must be addressed at both the Team Project Collection and Team Project scopes.

First, the Team Project Collection:

  1. Browse to http://[my_tfs_server]:8080/tfs/[my_collection_name]/_admin/_security?_a=members (your Collection's Security admin tab)
  2. Click on the TFS group "Project Collection Build Service Accounts"
  3. Ensure the user (not group) "Project Collection Build Service (TEAM FOUNDATION)" is a member of the group
  4. If it is not a member, add it with the "Add Windows user or group" menu, then Browse -- you should find it in the list of users

Second, the Team Project:

  1. Browse to http://[my_tfs_server]:8080/tfs/[my_collection_name]/[my_team_project]/_admin/_versioncontrol

  2. Ensure the user (not group) "Project Build Service (TEAM FOUNDATION)" is present in the security list (along with the "Project Collection Build Service Accounts" group)

  3. If it is not a member, add it with the "Add Windows identity" menu, then Browse -- you should find it in the list of users

Third, ensure that the "Project Collection Build Service Accounts" group and "Project Build Service (TEAM FOUNDATION)" user have appropriate version control rights, such as Read and Label. Make sure that Inheritance is set to On.

With these permissions in place, the -1 issue should resolve.

3
votes

"workspace version -1" usually occurs when there is no permission to access to the source control. Check the "Inheritance" settings for the folders in your source control and make sure it is set to "On". Refer to this link for details: TFS 2015 Build Agent failing syncing the repository.

Similar question here: TFS 2015 build agent failing to sync TFVC.

1
votes

This maybe a long path error. A way to fix this issue is to reset the workfolder path.

The default work folder location is a _work folder directly under the agent installation directory. You can change the location to be outside of the agent installation directory, for example: /WorkFolder:C:_work. One reason you may want to do this is to avoid "path too long" issues on the file system.

Source link

And also set Clean = "false". This may also be the root cause. If you have set /Project/Samples and build the definition. It will pull down all files under /project/Samples. Set the long path again, there has been files in the working folder. TFS may not get the new files. Set Clean= "True" and try it again.