TeamCity + VSTS - 无法在代理目标文件上执行签出已存在

时间:2017-01-06 18:11:57

标签: teamcity

我正在尝试基于Visual Studio Team Services配置TeamCity构建,并且我遇到以下错误。

我可以看到文件已下载到结帐目录( C:\ TeamCity \ buildAgent \ work \ e3b96b8eb42644db ),所以我可以弄清楚为什么会发生这种情况。

[18:04:51]Starting the build on the agent MYAGENT
[18:04:54]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[18:04:54]Publishing internal artifacts
[18:04:54][Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[18:04:54][Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[18:04:54]Using vcs information from agent file: e3b96b8eb42644db.xml
[18:04:54]Checkout directory: C:\TeamCity\buildAgent\work\e3b96b8eb42644db
[18:04:54]Updating sources: auto checkout (on agent) (32s)
[18:04:54][Updating sources] Will use agent side checkout
[18:04:54][Updating sources] VCS Root: tfs: https://myproject.visualstudio.com/ $/myproject Project (32s)
[18:04:54][VCS Root: tfs: https://myproject.visualstudio.com/ $/myproject Project] revision: 26497
[18:04:55][VCS Root: tfs: https://myproject.visualstudio.com/ $/myproject Project] Using java working mode
[18:04:55][VCS Root: tfs: https://myproject.visualstudio.com/ $/myproject Project] Receiving workspace (10s)
[18:05:05][Receiving workspace] Using workspace TeamCity-checkout-9755e46c9dbd4e2386cd6ff8f61f9c3f;2805f05d-0506-40bf-ace2-1cc59462cfac/MYAGENT
[18:05:05][VCS Root: tfs: https://myproject.visualstudio.com/ $/myproject Project] Updating sources to revision: 26497
[18:05:27][Updating sources] Failed to perform checkout on agent: Failed to checkout repository version 26497: com.microsoft.tfs.core.clients.versioncontrol.exceptions.VersionControlException: java.lang.IllegalArgumentException: renaming: target file already exists

任何提示?

2 个答案:

答案 0 :(得分:1)

安装Visual Studio后,问题就消失了。

我已经安装了它,因为我在日志中找到了以下信息:

C:\TeamCity\buildAgent\plugins\tfs-agent\bin\tfs-native.exe @@C:\TeamCity\buildAgent\temp\globalTmp\TC-TFS-595-4405_66\command.params, in file: {/CheckApi} has failed with exit code 1: No TFS assemblies were found on the system. Please make sure you have Microsoft Team Explorer installed. Supported versions: 2017 2015 2013 2012 2010 2008 2005 
[2017-01-09 17:53:25,670]   INFO - cs.tfs.TfsAgentServiceProvider - Use Java TFS SDK 
[2017-01-09 17:53:25,671]   INFO - s.tfs.TfsUpdateByCheckoutRules - Clean checkout flag was set by the build agent 
[2017-01-09 17:53:31,714]   INFO - .tfs.java.TfsJavaConsoleRunner - TFS java console command has finished: ListWorkspaces -s="https://myproject.visualstudio.com/" -u="*******" -p="*******" -inputFile=C:\TeamCity\buildAgent\temp\globalTmp\TC-TFS-595-4405_67.tmp -outputFile=C:\TeamCity\buildAgent\temp\globalTmp\TC-TFS-595-4405_68.tmp, completed in 5.998 second(s) 
[2017-01-09 17:53:31,717]   INFO - s.vcs.tfs.TfsWorkspaceProvider - Using workspace TeamCity-checkout-9ee0800418e64e77b38b598f7d5b15a5;2805f05d-0506-40bf-ace2-1cc59462cfac/MYAGENT 
[2017-01-09 17:55:21,600]   INFO - ldServer.AGENT.PollingProtocol - New command is received from server "agentFileManager

我认为这与Java TFS SDK有关。 我知道安装VS并不是最优雅的解决方案,特别是对于构建服务器。如果您有任何其他想法,请分享。

答案 1 :(得分:0)

如果您在项目中修改了文件,通常会发生这种情况。因此,TFS无法自动覆盖您更改的文件。尝试签入挂起的更改或清理文件夹。