问题描述
我们将TFS 2015与新的构建定义结合使用。我们只有一个池和一个构建代理。我们有多个构建定义和持续集成。
We use TFS 2015 with the new build definitions. We have only one pool and one build agent. We have multiple build definitions and continuous integration.
当我们更改多个解决方案使用的常规代码并进行签入时,将触发多个构建。
When we change general code, which is used by multiple solutions and we do a checkin, then multiple builds will be triggered.
我们得到以下异常:
无法在对象'Task.tbl_AgentRequest'中插入具有唯一索引'IX_Task_tbl_AgentRequest_PoolId_QueueTime'的重复键行。重复键值为(1,1,2017-04-12 12:27:22.8966667)。
有时它只是第一个构建定义,有时是前两个和有时即使是前三个也会因同样的例外而失败。其他构建进展顺利。它并不总是相同的构建,它取决于哪个将首先被触发。
Sometimes it's only the first build definition, sometimes the first two and sometimes even the first three fail with the same exception. The other builds are going good. It's not always the same build, it depends which will be triggered first.
所以似乎问题在于池中,某种时间问题。
So it seems that the problem is in the pool, some kind of timings issue.
第一周一切运行正常且突然(我们没有改变任何东西)发生了这个错误。
The first week everything was running fine and suddenly (we didn't change anything) this error occured.
我重新启动了Windows服务器,但仍然发生同样的错误。
I rebooted the windows server, but still the same error occurs.
在我们遇到另一个问题的前一周,工作区已经在使用中。我删除了再次创建代理的构建代理,并且该错误消失了。现在我们得到了这个错误。我们的经验是新的TFS 2015构建非常不稳定。
The week before we had another issue, that the workspace was already in use. I removed the build agent en created the agent again and that error was gone. Now we get this error. Our experience is that the new TFS 2015 build is very unstable.
几周前我们从TFS 2012迁移到TFS 2015,所以在我们进行XAML构建之前我们从未遇到过这种例外情况
Few weeks ago we migrated from TFS 2012 to TFS 2015, so before we had XAML builds and we never had this kind of exceptions
推荐答案
感谢您在此发帖。
根据错误消息,它似乎是由池中代理请求的冲突引起的。
请尝试以下事项:
1.在代理机器中清理缓存。
According to the error message, it seems it’s caused by the conflict of agent request in the pool.
Please try below things:
1. Clean caches in Agent machine.
2。尝试删除构建代理,下载并配置新的构建代理。
3.删除旧池并创建新池,然后在新池中配置代理。
然后再次检查问题。
2. Try to remove the build agent, download and configure a new build agent.
3. Delete the old pool and create a new pool, then configure the agent in the new pool.
Then check the issue again.
最好的问候。
这篇关于构建期间重复键异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!