TFS 2015 Build Agent failing syncing the repository 获取源码 不全 失败

当我们使用TFS2015d的生成代理时,我们将生成定义加入代理池队列中,但是代理可能无法完全下载我们在TFS代码浏览器中看到的所有目录,这肯定会导致编译失败呀!为什么呢?

原因在于tfscompile这个账号在某个项目的版本控制中,对某个源码目录没有权限

但是不可能啊,我们已经在根节点上给了权限了呀,

是的,你的确给了根目录所有权限,但是仔细观察你会发现,有个关于继承的隐藏开关

如果某个目录勾选了“关闭”,那么这个目录对TFSCOMPILE账号就无权访问,当然生成代理就无法下载咯。

因此,我们还是仔细点,挨个目录检查一遍。

当然,其实这个功能是有用的,比如我就是想让TFSCOMPILE不下载某个目录(比如branchs等)。

下面是老外对这个问题的解释和解决方案

I would like to share with you my last struggle with TFS. I received a call from a colleague about some problem with the ‘new’ TFS build. Initially I tough it is only a miss-configuration and that the solution will be trivial, but as you can imagine, it wasn’t.

The problem lied in the fact that build agent couldn’t retrieve the sources and the error message was not treated as such. You could only see logged a (workspace version -1) inside the Get Sources step, after stating that syncing the repository was done.

As a first thing, I tough about agent not having sufficient rights to retrieve the source code. After a quick check and making sure that the agent service user has sufficient rights to retrieve the code, I run my build again and I got the same result. Didn’t helped.

Next thing I checked all sort of settings, running the build on a different build agent on different server, running the agent under different account, making sure that permissions for the _work folder are setup correctly, all sort of things. I ended up realizing that if I moved the code from that Team project to another team project, suddenly my build agent was able to retrieve the code again. There where two things, or the project was corrupted or there where some security issues. Thanks to the Microsoft support assistance, I managed to get to the right solution. And guess what? It was a security issue.

For an unknown reason the permission inheritance was disabled on the folder that contained all of the interested branches.

By enabling this setting, I saw that there is a small change in the way build agents are authenticated against TFVC. XAML build agent identifies itself with the user that agent runs under. 2015 build agent in the other hand, uses a Project Collection Build Service group to do so. It is added automatically to the source code permissions tree, and in order to propagate it needs to have the permission inheritance switched on or you need to manually set rights for that user group.

Same goes for the owner of the local workspace created by the agent.

You can change those settings by editing the security for a give item in the source control.

Once this is done, you should see your build agent syncing the sources correctly.

Hi Adam, that’s exactly what I do mention in the post. Also in yesterdays post on MSDN ALM Blog (http://blogs.msdn.com/b/visualstudioalm/archive/2016/01/07/receive-an-error-when-resolving-a-bug-created-by-your-build.aspx) they do mention the same: new build system uses a service account. That service account should be automatically inherited, and in case the inheritance is set to off, it doesn’t happen. You can have inheritance set to off and still make it work by manually adding the above mentioned account and granting the necessary rights.

时间: 2024-08-26 12:48:32

TFS 2015 Build Agent failing syncing the repository 获取源码 不全 失败的相关文章

搭建TFS 2015 Build Agent环境(一)

Download the build agent Downloading the build agent is really simple. Navigate to your TFS control panel, click on Agent pools and then Download agent. This post will assume you have setup your agent pool already but that's as simple as click New po

搭建TFS 2015 Build Agent环境(三)

在配置时,一定要注意下面的几个地方: 1.项目集合生成服务账号 中一定要包含: 2.Build Agent机器上防止Agent的路径一定要短,不要出现特殊字符,比如:C:\Agent 3.一定要安装VS2015之后,在执行Agent的config.否则会提示找不到MSBuild和VS的. 4.如果上不步骤执行还不行.请执行 configureAgent.cmd remove执行后,重新注册服务并启动.一定要确保agent是在线的.

搭建TFS 2015 Build Agent环境(二)

在执行和安装配置的过程中,注意一定要使用管理员权限运行:ConfigureAgent.cmd 和RunAgent.cmd.配置的过程中,要注意几个内容:1.TFS地址不要写DefaultCollection信息,只写到tfs即可.比如:http://xxx:8080/tfs. 2.在输入PoolName时,一定要确保是已经存在的PoolName.可以从下图中的位置确认. 3.执行完配置后,如果发现代理没有注册成功,建议不要折腾了.从下面地址下载新的版本吧. https://github.com/

浅谈 qmake 之 shadow build(就是将源码路径和构建路径分开)

shadow build shadow build 是什么东西?就是将源码路径和构建路径分开(也就是生成的makefile文件和其他产物都不放到源码路径),以此来保证源码路径的清洁. 这不是qmake独创的东西,cmake中早就使用这个东西了   cmake qmake 备注 in-source cmake . qmake project.pro 在源码路径下执行 out-of-source(shadow-build) mkdir build cd buildcmake ../project m

In-Place upgrade to Team Foundation Server (TFS) 2015 from TFS 2013Team Foundation Server TFS TFS 2015 TFS upgrade TFS with Sharepoint

This upgrade document gives detailed step by step procedure for the In-Place upgrade from TFS 2013 to 2015 RTM with Reporting and SharePoint. Environment Details: TFS 2013 environment Windows server 2012 R2, TFS 2013 update 5, SQL 2014 SP1, SharePoin

TFS 2015新功能之一,当前迭代查询标记

TFS 2015发布在即,有幸作为MVP提前获得了TFS的RTM版本,下面就TFS 2015的新功能做一些介绍:   TFS 2015新功能之一,当前迭代查询标记 在TFS的查询中,可以将"迭代路径"做为筛选条件获得需要的工作项.但是在实际使用过程中,经常需要将当前迭代作为筛选条件,例如需要获取当前迭代为完成的任务:而当前迭代是经常变化的,进入到下一个月后,当前迭代就变了,如果工作项查询条件不支持自动变化,则查询出来的结果还是上一个迭代的工作项,不得不手动去修改查询条件,设置为当前的迭

TFS 2015 Update 2功能探索

微软刚刚发布了TFS 2015 update 2的测试包,https://blogs.msdn.microsoft.com/bharry/2016/02/10/team-foundation-server-2015-update-2-rc-1-is-available/. 相对Update 1,这次更新包含了很多用户期待的功能,作者第一时间下载更新了自己的系统,并与大家分享经验. 1. 升级TFS 2015.1到Update 2 Update 2的安装过程与之前的版本一样,安装过程非常简单,加载

#VSTS日志# TFS 2015 Update 2 RC2新功能

有段时间没有更新#VSTS日志#了,最近小编太忙,全国各地飞来飞去给各种不同的团队实施敏捷,今天冷不丁一看,呀!TFS 2015 Update 2 RC2都已经发布了.里面好东西不少,列出几个给大家瞧瞧. 使用TFS Web来创建和删除团队项目 用过TFS的人都知道,要给TFS创建项目那是必须要安装对等版本的Visual Studio的,不管您是用微软开发技术还是用微软开发技术,反正就算你是干Java的,也得装.随便装一个最小的,也要5个G,就算是硬盘不是问题,时间也是问题.现在好了,打开浏览器

TFS 2015 敏捷开发实践 – 看板的使用

看板在现代应用开发过程中使用非常广泛,不管是使用传统的瀑布式开发还是敏捷开发,都可以使用看板管理.因为看板拥有简单的管理方法,直观的显示方式,所以很多软件开发团队选择使用看板进行软件开发管理.本文不在对看板管理理论进行过多的赘述了,只是在这里介绍一下如何使用TFS的看板功能.最新版本的TFS提供了功能强大的电子看板(最新发布的TFS 2015 Update 2.1中,也包含了对看板功能的提升),并且能对看板的显示进行大量定制,而且还加入了泳道的功能.开发团队可以根据自己的需求来定制属于自己团队的