azure-pipelines-agent: Get sources task does not work in a second Agent

Have you try trouble shooting doc?

yes I have.

Agent version and platform

Version of your agent? 2.112.0/2.115. OS:Windows

VSTS type and version

TFS 2017 Update 1

What’s not working?

I installed the agent in a Windows Server 2012, Agent1 (Version 2.112) . After some troubles trying to get the sources and change manually the workspace from local to server, the builds in that agent are working fine. I proceed to install a second agent in the machine in order to compile another branch of my code. I was expecting a failure after the first try, due the experience with the firs agent. Indeed it fail:

2017-04-06T21:36:07.1206801Z ##[section]Starting: Get Sources
2017-04-06T21:36:07.1346710Z ##[debug]Primary repository: MyApp2. repository type: TfsVersionControl
2017-04-06T21:36:07.1356725Z ##[debug]Preparing build directory.
2017-04-06T21:36:07.1746806Z ##[debug]Delete existing artifacts directory: 'c:\_LIN2\1\a'
2017-04-06T21:36:07.1746806Z ##[debug]Deleting artifacts directory: 'c:\_LIN2\1\a'
2017-04-06T21:36:07.2326779Z ##[debug]Creating artifacts directory: 'c:\_LIN2\1\a'
2017-04-06T21:36:07.2336788Z ##[debug]Delete existing test results directory: 'c:\_LIN2\1\TestResults'
2017-04-06T21:36:07.2336788Z ##[debug]Deleting test results directory: 'c:\_LIN2\1\TestResults'
2017-04-06T21:36:07.2346832Z ##[debug]Creating test results directory: 'c:\_LIN2\1\TestResults'
2017-04-06T21:36:07.2346832Z ##[debug]Set build variables.
2017-04-06T21:36:07.2366789Z ##[debug]Sync source for endpoint: MyApp2
2017-04-06T21:36:07.2966813Z Prepending Path environment variable with directory containing 'tf.exe'.
2017-04-06T21:36:07.2976794Z ##[debug]Path: 'C:\Builds\LINAgent2\externals\vstsom;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\SafeNet\Authentication\SAC\x64;C:\Program Files\SafeNet\Authentication\SAC\x32;C:\setup\phantomjs-2.1.1-windows\bin\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\nodejs\;C:\Users\tfs_bog_build_servic\AppData\Roaming\npm;C:\Builds\LINAgent2\bin;C:\Builds\LINAgent2\bin'
2017-04-06T21:36:07.2976794Z Querying workspace information.
2017-04-06T21:36:07.3116800Z ##[debug]tf vc workspaces /format:xml /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:09.8358246Z ##[debug]<Workspaces>
2017-04-06T21:36:09.8358246Z ##[debug]  <Workspace computer="BOGBUILD1" name="ws_1_145" ownerdisp="Project Build Service (TEAM FOUNDATION)" ownerid="29c1f3a3-c0cc-4640-8040-f0b4b272408c:Build:0a4fa1eb-b731-4e32-9cb9-37861080ffa7" ownertype="Microsoft.TeamFoundation.ServiceIdentity" owner="6444ed90-66b1-4fb1-a339-34a11a5e7289" owneruniq="6444ed90-66b1-4fb1-a339-34a11a5e7289">
2017-04-06T21:36:09.8358246Z ##[debug]    <Comment />
2017-04-06T21:36:09.8358246Z ##[debug]    <Folders>
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder local="c:\_LIN1\1\s" item="$/MyApp2/Dev/FT2" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Architecture" type="Cloak" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/BestPractices" type="Cloak" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Databases" type="Cloak" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Environment/Lint" type="Cloak" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Environment/ReSharper" type="Cloak" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Workspaces" type="Cloak" />
2017-04-06T21:36:09.8358246Z ##[debug]    </Folders>
2017-04-06T21:36:09.8358246Z ##[debug]    <LastAccessDate>2017-04-05T19:00:03.26-05:00</LastAccessDate>
2017-04-06T21:36:09.8358246Z ##[debug]    <OwnerAliases>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>Build\0a4fa1eb-b731-4e32-9cb9-37861080ffa7</string>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>0a4fa1eb-b731-4e32-9cb9-37861080ffa7</string>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>Project Build Service (TEAM FOUNDATION)</string>
2017-04-06T21:36:09.8358246Z ##[debug]    </OwnerAliases>
2017-04-06T21:36:09.8358246Z ##[debug]  </Workspace>
2017-04-06T21:36:09.8358246Z ##[debug]  <Workspace computer="BOGBUILD1" islocal="true" name="ws_1_146" ownerdisp="Project Build Service (TEAM FOUNDATION)" ownerid="29c1f3a3-c0cc-4640-8040-f0b4b272408c:Build:0a4fa1eb-b731-4e32-9cb9-37861080ffa7" ownertype="Microsoft.TeamFoundation.ServiceIdentity" owner="6444ed90-66b1-4fb1-a339-34a11a5e7289" owneruniq="6444ed90-66b1-4fb1-a339-34a11a5e7289">
2017-04-06T21:36:09.8358246Z ##[debug]    <Comment />
2017-04-06T21:36:09.8358246Z ##[debug]    <Folders>
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder local="c:\_LIN2\1\s" item="$/MyApp2/Main" />
2017-04-06T21:36:09.8358246Z ##[debug]    </Folders>
2017-04-06T21:36:09.8358246Z ##[debug]    <LastAccessDate>2017-04-06T16:34:57.51-05:00</LastAccessDate>
2017-04-06T21:36:09.8358246Z ##[debug]    <OwnerAliases>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>Build\0a4fa1eb-b731-4e32-9cb9-37861080ffa7</string>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>0a4fa1eb-b731-4e32-9cb9-37861080ffa7</string>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>Project Build Service (TEAM FOUNDATION)</string>
2017-04-06T21:36:09.8358246Z ##[debug]    </OwnerAliases>
2017-04-06T21:36:09.8358246Z ##[debug]  </Workspace>
2017-04-06T21:36:09.8358246Z ##[debug]  <Workspace computer="BOGBUILD1" name="ws_2_145" ownerdisp="Project Collection Build Service (TEAM FOUNDATION)" ownerid="29c1f3a3-c0cc-4640-8040-f0b4b272408c:Build:6bd3df57-5fb8-4579-8b41-5310e521a753" ownertype="Microsoft.TeamFoundation.ServiceIdentity" owner="52b77df3-3655-45a3-b17a-f38ce5a0e671" owneruniq="52b77df3-3655-45a3-b17a-f38ce5a0e671">
2017-04-06T21:36:09.8358246Z ##[debug]    <Comment />
2017-04-06T21:36:09.8358246Z ##[debug]    <Folders>
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder local="c:\_LIN1\2\s\Environment" item="$/MyApp2/Dev/FT2/Environment" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder local="c:\_LIN1\2\s\Products" item="$/MyApp2/Dev/FT2/Products" />
2017-04-06T21:36:09.8358246Z ##[debug]      <WorkingFolder local="c:\_LIN1\2\s\Quality" item="$/MyApp2/Dev/FT2/Quality" />
2017-04-06T21:36:09.8358246Z ##[debug]    </Folders>
2017-04-06T21:36:09.8358246Z ##[debug]    <LastAccessDate>2017-04-06T03:00:15.4-05:00</LastAccessDate>
2017-04-06T21:36:09.8358246Z ##[debug]    <OwnerAliases>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>Build\6bd3df57-5fb8-4579-8b41-5310e521a753</string>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>6bd3df57-5fb8-4579-8b41-5310e521a753</string>
2017-04-06T21:36:09.8358246Z ##[debug]      <string>Project Collection Build Service (TEAM FOUNDATION)</string>
2017-04-06T21:36:09.8358246Z ##[debug]    </OwnerAliases>
2017-04-06T21:36:09.8358246Z ##[debug]  </Workspace>
2017-04-06T21:36:09.8358246Z ##[debug]</Workspaces>
2017-04-06T21:36:10.2908510Z ##[debug]Attempting to find a workspace: 'ws_1_146'
2017-04-06T21:36:10.2918522Z ##[debug]Skipping workspace: 'ws_1_145'
2017-04-06T21:36:10.2918522Z ##[debug]Candidate workspace: 'ws_1_146'
2017-04-06T21:36:10.2918522Z ##[debug]Expected number of mappings: '7'. Actual: '1'
2017-04-06T21:36:10.2918522Z ##[debug]Skipping workspace: 'ws_2_145'
2017-04-06T21:36:10.2918522Z ##[debug]Matching workspace not found.
2017-04-06T21:36:10.3018518Z ##[command]tf vc workspace /delete ws_1_146;6444ed90-66b1-4fb1-a339-34a11a5e7289 /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:11.9989521Z ##[debug]tf vc workspaces ws_1_146 /computer:* /format:xml /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:14.5950975Z ##[debug]<Workspaces />
2017-04-06T21:36:14.6171005Z ##[debug]Deleting: 'c:\_LIN2\1\s'.
2017-04-06T21:36:14.6210971Z ##[command]tf vc workspace /new /location:local /permission:Public ws_1_146 /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:18.2563266Z ##[command]tf vc workfold /unmap /workspace:ws_1_146 $/ /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:21.1604729Z ##[command]tf vc workfold /map /workspace:ws_1_146 $/MyApp2/Main c:\_LIN2\1\s /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:24.0556401Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Databases /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:26.9188063Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Workspaces /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:29.7689696Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Architecture /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:32.6861310Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/BestPractices /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:35.5562993Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Environment/Lint /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:38.4174611Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Environment/ReSharper /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:36:41.3176318Z ##[command]tf vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:38:35.1811527Z Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
2017-04-06T21:38:35.2791549Z ##[error]Exit code 100 returned from process: file name 'tf', arguments 'vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt'.
2017-04-06T21:38:35.2871549Z ##[debug]Microsoft.VisualStudio.Services.Agent.ProcessExitCodeException: Exit code 100 returned from process: file name 'tf', arguments 'vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt'.
   at Microsoft.VisualStudio.Services.Agent.ProcessInvoker.<ExecuteAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsVCCommandManager.<RunCommandAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.TFCommandManager.<GetAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsVCSourceProvider.<GetSourceAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildJobExtension.<PrepareAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.JobExtensionRunner.<RunAsync>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.<RunAsync>d__0.MoveNext()
2017-04-06T21:38:35.2921551Z ##[section]Finishing: Get Sources

then I proceed to change the new workspace to Server, moreover I ran EnsureUpdateWorkspaceInfoCache for the workspace, and queued a new build, I got this:

2017-04-06T21:55:29.8709858Z ##[section]Starting: Get Sources
2017-04-06T21:55:30.0489945Z Prepending Path environment variable with directory containing 'tf.exe'.
2017-04-06T21:55:30.0489945Z Querying workspace information.
2017-04-06T21:55:33.0351060Z ##[command]tf vc workspace /delete ws_1_146;6444ed90-66b1-4fb1-a339-34a11a5e7289 /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:37.1262652Z ##[command]tf vc workspace /new /location:local /permission:Public ws_1_146 /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:40.7774031Z ##[command]tf vc workfold /unmap /workspace:ws_1_146 $/ /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:43.6705166Z ##[command]tf vc workfold /map /workspace:ws_1_146 $/MyApp2/Main c:\_LIN2\1\s /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:46.5696213Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Databases /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:49.4857323Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Workspaces /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:52.3758450Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Architecture /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:55.2939598Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/BestPractices /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:55:58.1850659Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Environment/Lint /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:56:01.0611755Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Environment/ReSharper /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:56:04.0612928Z ##[command]tf vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt
2017-04-06T21:58:11.7194016Z Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
2017-04-06T21:58:11.8164072Z ##[error]Exit code 100 returned from process: file name 'tf', arguments 'vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt'.
2017-04-06T21:58:11.8284076Z ##[section]Finishing: Get Sources

I start wondering why it has to delete the previously created workspace. I queued again another build this time with the Debug enabled, I got:

2017-04-06T22:08:49.8462519Z ##[section]Starting: Get Sources
2017-04-06T22:08:49.8602529Z ##[debug]Primary repository: MyApp2. repository type: TfsVersionControl
2017-04-06T22:08:49.8602529Z ##[debug]Preparing build directory.
2017-04-06T22:08:49.8992564Z ##[debug]Delete existing build directory: 'c:\_LIN2\1'
2017-04-06T22:08:49.9002552Z ##[debug]Deleting build directory: 'c:\_LIN2\1'
2017-04-06T22:08:49.9622607Z ##[debug]Creating build directory: 'c:\_LIN2\1'
2017-04-06T22:08:49.9632660Z ##[debug]Delete existing artifacts directory: 'c:\_LIN2\1\a'
2017-04-06T22:08:49.9632660Z ##[debug]Creating artifacts directory: 'c:\_LIN2\1\a'
2017-04-06T22:08:49.9642575Z ##[debug]Delete existing test results directory: 'c:\_LIN2\1\TestResults'
2017-04-06T22:08:49.9642575Z ##[debug]Creating test results directory: 'c:\_LIN2\1\TestResults'
2017-04-06T22:08:49.9642575Z ##[debug]Creating binaries directory: 'c:\_LIN2\1\b'
2017-04-06T22:08:49.9652582Z ##[debug]Creating source directory: 'c:\_LIN2\1\s'
2017-04-06T22:08:49.9652582Z ##[debug]Set build variables.
2017-04-06T22:08:49.9662587Z ##[debug]Sync source for endpoint: MyApp2
2017-04-06T22:08:50.0252622Z Prepending Path environment variable with directory containing 'tf.exe'.
2017-04-06T22:08:50.0252622Z ##[debug]Path: 'C:\Builds\LINAgent2\externals\vstsom;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\SafeNet\Authentication\SAC\x64;C:\Program Files\SafeNet\Authentication\SAC\x32;C:\setup\phantomjs-2.1.1-windows\bin\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\nodejs\;C:\Users\tfs_bog_build_servic\AppData\Roaming\npm;C:\Builds\LINAgent2\bin;C:\Builds\LINAgent2\bin'
2017-04-06T22:08:50.0262623Z Querying workspace information.
2017-04-06T22:08:50.0402629Z ##[debug]tf vc workspaces /format:xml /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:08:52.5534070Z ##[debug]<Workspaces>
2017-04-06T22:08:52.5534070Z ##[debug]  <Workspace computer="BOGBUILD1" name="ws_1_145" ownerdisp="Project Build Service (TEAM FOUNDATION)" ownerid="29c1f3a3-c0cc-4640-8040-f0b4b272408c:Build:0a4fa1eb-b731-4e32-9cb9-37861080ffa7" ownertype="Microsoft.TeamFoundation.ServiceIdentity" owner="6444ed90-66b1-4fb1-a339-34a11a5e7289" owneruniq="6444ed90-66b1-4fb1-a339-34a11a5e7289">
2017-04-06T22:08:52.5534070Z ##[debug]    <Comment />
2017-04-06T22:08:52.5534070Z ##[debug]    <Folders>
2017-04-06T22:08:52.5534070Z ##[debug]      <WorkingFolder local="c:\_LIN1\1\s" item="$/MyApp2/Dev/FT2" />
2017-04-06T22:08:52.5534070Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Architecture" type="Cloak" />
2017-04-06T22:08:52.5534070Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/BestPractices" type="Cloak" />
2017-04-06T22:08:52.5534070Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Databases" type="Cloak" />
2017-04-06T22:08:52.5534070Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Environment/Lint" type="Cloak" />
2017-04-06T22:08:52.5534070Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Environment/ReSharper" type="Cloak" />
2017-04-06T22:08:52.5534070Z ##[debug]      <WorkingFolder item="$/MyApp2/Dev/FT2/Workspaces" type="Cloak" />
2017-04-06T22:08:52.5534070Z ##[debug]    </Folders>
2017-04-06T22:08:52.5534070Z ##[debug]    <LastAccessDate>2017-04-05T19:00:03.26-05:00</LastAccessDate>
2017-04-06T22:08:52.5544054Z ##[debug]    <OwnerAliases>
2017-04-06T22:08:52.5544054Z ##[debug]      <string>Build\0a4fa1eb-b731-4e32-9cb9-37861080ffa7</string>
2017-04-06T22:08:52.5544054Z ##[debug]      <string>0a4fa1eb-b731-4e32-9cb9-37861080ffa7</string>
2017-04-06T22:08:52.5544054Z ##[debug]      <string>Project Build Service (TEAM FOUNDATION)</string>
2017-04-06T22:08:52.5544054Z ##[debug]    </OwnerAliases>
2017-04-06T22:08:52.5544054Z ##[debug]  </Workspace>
2017-04-06T22:08:52.5544054Z ##[debug]  <Workspace computer="BOGBUILD1" name="ws_2_145" ownerdisp="Project Collection Build Service (TEAM FOUNDATION)" ownerid="29c1f3a3-c0cc-4640-8040-f0b4b272408c:Build:6bd3df57-5fb8-4579-8b41-5310e521a753" ownertype="Microsoft.TeamFoundation.ServiceIdentity" owner="52b77df3-3655-45a3-b17a-f38ce5a0e671" owneruniq="52b77df3-3655-45a3-b17a-f38ce5a0e671">
2017-04-06T22:08:52.5544054Z ##[debug]    <Comment />
2017-04-06T22:08:52.5544054Z ##[debug]    <Folders>
2017-04-06T22:08:52.5544054Z ##[debug]      <WorkingFolder local="c:\_LIN1\2\s\Environment" item="$/MyApp2/Dev/FT2/Environment" />
2017-04-06T22:08:52.5544054Z ##[debug]      <WorkingFolder local="c:\_LIN1\2\s\Products" item="$/MyApp2/Dev/FT2/Products" />
2017-04-06T22:08:52.5544054Z ##[debug]      <WorkingFolder local="c:\_LIN1\2\s\Quality" item="$/MyApp2/Dev/FT2/Quality" />
2017-04-06T22:08:52.5544054Z ##[debug]    </Folders>
2017-04-06T22:08:52.5544054Z ##[debug]    <LastAccessDate>2017-04-06T03:00:15.4-05:00</LastAccessDate>
2017-04-06T22:08:52.5544054Z ##[debug]    <OwnerAliases>
2017-04-06T22:08:52.5544054Z ##[debug]      <string>Build\6bd3df57-5fb8-4579-8b41-5310e521a753</string>
2017-04-06T22:08:52.5544054Z ##[debug]      <string>6bd3df57-5fb8-4579-8b41-5310e521a753</string>
2017-04-06T22:08:52.5544054Z ##[debug]      <string>Project Collection Build Service (TEAM FOUNDATION)</string>
2017-04-06T22:08:52.5544054Z ##[debug]    </OwnerAliases>
2017-04-06T22:08:52.5544054Z ##[debug]  </Workspace>
2017-04-06T22:08:52.5544054Z ##[debug]</Workspaces>
2017-04-06T22:08:53.0064350Z ##[debug]Sources directory does not exist or is empty.
2017-04-06T22:08:53.0124319Z ##[debug]tf vc workspaces ws_1_146 /computer:* /format:xml /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:08:55.5565850Z ##[debug]<Workspaces />
2017-04-06T22:08:55.5775874Z ##[debug]Deleting: 'c:\_LIN2\1\s'.
2017-04-06T22:08:55.5845852Z ##[command]tf vc workspace /new /location:local /permission:Public ws_1_146 /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:08:59.4078260Z ##[command]tf vc workfold /unmap /workspace:ws_1_146 $/ /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:02.3189778Z ##[command]tf vc workfold /map /workspace:ws_1_146 $/MyApp2/Main c:\_LIN2\1\s /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:05.1971424Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Databases /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:08.1432988Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Workspaces /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:11.0664667Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Architecture /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:13.9466312Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/BestPractices /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:16.8407998Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Environment/Lint /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:19.7679622Z ##[command]tf vc workfold /cloak /workspace:ws_1_146 $/MyApp2/Main/Environment/ReSharper /collection:https://tfs.MyCompany.net/tfs/Collection/ /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:09:22.6631295Z ##[command]tf vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt
2017-04-06T22:11:29.0743719Z Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
2017-04-06T22:11:29.1693799Z ##[error]Exit code 100 returned from process: file name 'tf', arguments 'vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt'.
2017-04-06T22:11:29.1784049Z ##[debug]Microsoft.VisualStudio.Services.Agent.ProcessExitCodeException: Exit code 100 returned from process: file name 'tf', arguments 'vc get /version:23501 /recursive /overwrite c:\_LIN2\1\s /loginType:OAuth /login:.,******** /noprompt'.
   at Microsoft.VisualStudio.Services.Agent.ProcessInvoker.<ExecuteAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsVCCommandManager.<RunCommandAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.TFCommandManager.<GetAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsVCSourceProvider.<GetSourceAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildJobExtension.<PrepareAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.JobExtensionRunner.<RunAsync>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.<RunAsync>d__0.MoveNext()
2017-04-06T22:11:29.1823793Z ##[section]Finishing: Get Sources

finally I download the latest version of the agent 2.115, Create a new agent in the machine and try again. The behavior is the same.

In some of the error log tell that the s(sources) folder is empty, therefore it will delete the workspace, then I even try to download some files in the workspace and then queued a build, but the behavior is the same.

Is there a restriction for several agents in the same machine? How can I setup a Server workspace for the Agent? How to avoid the deletion of the workspace if the workspace is already present?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Ok, I try this:

  1. Queued a build (It fails, but creates the workspace)
  2. Manually perform the same "tf vc get " command that the failed build try to perform (took about 1.3 hours)
  3. Change the workspace to Server
  4. Queue a new Build

Can you check the AT server event log for any error? I’ll loop in Version Control folks to help troubleshoot.