问题
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:
Then the logs show that there is no SLN found, and I confirmed that nothing was downloaded to the agent working folders:
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?
回答1:
"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.
回答2:
This permissions issue must be addressed at both the Team Project Collection and Team Project scopes.
First, the Team Project Collection:
- Browse to http://[my_tfs_server]:8080/tfs/[my_collection_name]/_admin/_security?_a=members (your Collection's Security admin tab)
- Click on the TFS group "Project Collection Build Service Accounts"
- Ensure the user (not group) "Project Collection Build Service (TEAM FOUNDATION)" is a member of the group
- 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:
Browse to http://[my_tfs_server]:8080/tfs/[my_collection_name]/[my_team_project]/_admin/_versioncontrol
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)
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:
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.
来源:https://stackoverflow.com/questions/38445294/tfs-2015-build-is-not-getting-the-mapped-path