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.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
2015-08-05 myeclipse和eclipse的区别和联系,以及版本间的对应关系
2015-08-05 MyEclipse 2014 for Mac 在Yosemite怎樣安裝
2009-08-05 Windows Server 2003/2008上安装Windows Live Wave 3