TFS2015 build agent cannot sync repository - tfs

I am trying to set up build automation (it will be for CI in the future, but at the moment I'm queuing builds manually) on a TFS 2015 server, using the newer method, not the old XAML method. I have a build agent installed and registered (which seems to have gone okay), but every time I try and queue a build, it will fail when syncing the repository with the message "Unable to read data from the transport connection: The connection was closed."
The user that the build agent service is running as has access to the TFS repository.
As far as I know, there is no proxy between the build agent and the server.
The server is within the same network as the build agent; it is not Team Services.
The agent version is 1.83.2
What should I be looking for to fix this? The log is below:
2017-06-28T15:14:02.4032890Z Starting: Get sources
2017-06-28T15:14:02.4188890Z Entering TfvcSourceProvider.PrepareRepositoryAsync
2017-06-28T15:14:02.4188890Z localPath=C:\TFSBuildAgent\WorkFolder\ff694322\SCR
2017-06-28T15:14:02.4188890Z clean=False
2017-06-28T15:14:02.4188890Z sourceVersion=C13590
2017-06-28T15:14:02.4188890Z mappingJson={"mappings":[{"serverPath":"$/SCR","mappingType":"map"},{"serverPath":"$/SCR/Drops","mappingType":"cloak"}]}
2017-06-28T15:14:02.4188890Z Syncing repository: SCR (TFVC)
2017-06-28T15:14:02.4188890Z workspaceName=ws_ff694322_3
2017-06-28T15:14:03.5264910Z Workspace Name: ws_ff694322_3;Build\a2dd1d8a-5146-47c6-bda1-6f761cddeecd
2017-06-28T15:14:13.0113076Z ##[error]Unable to read data from the transport connection: The connection was closed.
2017-06-28T15:14:13.0425077Z ##[error]Unable to read data from the transport connection: The connection was closed.

You could try below ways to narrow down the issue:
Please check your TFS version, the agent version 1.83.2 is for
TFS 2015 RTM. if your TFS is not 2015 RTM , suggest you update the
agent to the specific version.
Check the event viewer on the TFS server if there are some related
error info.
Try to set other accounts which can get the
sources as the agent service account.
Try to deploy a new agent to check this issue again.
If you are using Window Server 2008R2, just try to apply the HotFix and try the workaround.

Related

How do I set up a dedicated TFS build server in TFS 2018?

We are using a server running Windows Server 2012 R2 for our TFS work item management and source control.
But we want to set up a dedicated Build server.
We are running TFS 2018 Update1.
I've downloaded the latest available Build agent and ran the script 'config.cmd' from the dedicated Build Server.
In previous versions of TFS you were at least supposed to run the TFS Installation Wizard if I'm correct to configure the Build Service. But this changed since TFS 2015.
But where can you see that my dedicated server (that I used to run config.cmd) is actually used for executing the Build process?
I cannot really find information on how to install and configure multiple servers for running TFS.
as far as I know running the config.cmd is enough. The machine where the script is executed will then register with the server instance - during the configuraiton you had to specify the TFS Server URL right?
On the Server side, you can go to the Agent Pools (where you initially downloaded the Agent Configuration). After clicking on the Agent Pools on the left-hand side you should see all Agents registered to that Queue. To which Queue your agent belongs was as well specified during the configuration on the agent itself as part of the config.cmd.
If you want to add more agents, you can simply run the config.cmd on other machine and register your agent with the same server instance. It is even possible to have more than one agent on the same physical hardware if you want that.

TFS build/release agents "update all agents" is not updating the agents for TFS on-prem 2017

For on-prem TFS 2017 when I try to update all agents in the agent pools, the update does not happen. I see the same old agent version.
Build servers typically do not have internet connectivity.
Is internet connectivity a pre-requisite for updating on prem build agents?
I had to download the new agent for a machine where I have internet and then copied the files over to a new folder in the build machine and reconfigured the agent from this new folder. After this is done I had 2 agent services - 1 pointing to older folder and 1 pointing to new folder. The service pointing to old folder was started and the new service was in stopped state. Stopped the old service and started the new service.
Is the process different for updating agent version for on-prem TFS?
Even if you have Internet connection, the update may not work.
According to Daniel Steiner there are 2 kinds of agents:
Windows specific agents (version 1.x)
cross platform agents (version 2.x)
In TFS 2017 the Windows specific agents (version 1.x) are deprecated. Thus they won't be updated from the agent queues admin area. So you have to download the agent from tfs (or github) and install it yourself. After initial installation/configuration the agent updates via tfs should work again. It would have been cool if they automated that process or at least said what to do in tfs.
Unfortunately the official docu does not make the whole issue clear enough.
Yes you need internet connectivity for updating on prem build agents.
Each agent automatically updates itself when it runs a task that
requires a newer version of the agent. But if you want to manually
update some agents, right-click the pool, and then click Update all
agents.
All build agents within the selected pool will go offline temporarily and then come back online as soon as they are updated.
Which you have done is manually adding a newly version agent, not updating the agent. There are just two agents in your build server,so you had two agent services.
More details about update agent in on-premise TFS server, you could refer below tutorials:
Updating Your Team Foundation Build Agents
Upgrading TFS 2015 Build Agent

SCVMM tfs task to restore to check point failure

We had SCVMM task in our release definitions in order to revert the snapshots, these tasks were working fine until the build agent was upgraded to version 2.112.0.
The task does not complete, the following message "Please wait Restore action is in Progress", seemes to be stuck indefinitely.
We have tried by creating new service endpoint following the instructions published here: https://www.visualstudio.com/en-us/docs/build/apps/cd/restore-vm-in-scvmm
Double checked all the user rights required to preform scvmm operations using tfs, still not able to resolve the issue.
Root cause of the error was that the the build agents could not communicate to SCVMM server, this issue was resolved by maintaining the consistent SCVMM console version among build agent and SCVMM server.

Error when scheduled build in Agent queue tries to sync repository

I am using an TFS agent to schedule some Build using triggers. My issue is that when the build starts it wants to get latest version (sync repository). But I get an unusual error:
I have literally no ideea where to begin, it's like it could reach the server or something.
I could not comment. Hence providing an answer.
Does the account your agent is running under, has rights to the TFS repository mapped in the build?
For more logs check the logs in D:\Kits\agent_diag folder.

Is it possible to run TFS Build Agent without installing TFS Server on the machine?

I just finished setup two build agent on a server. From what I think, I don't need to install TFS Server on this machine because it use as build agents not the server itself. I might need to install TFS Server to configure the build agents but I hope I can uninstall them after I finished configuring.
I am not sure is it possible to run TFS Build Agent without installing TFS server or not?
You do not have to have the application tier (server) configured on the build agent machine.
You can install the build agent but in order to fully configure the build agent, it will need to be configured against a server's collection (local or remote).
Step 3 in the wizard covered here, details how you need to browse and select the collection the build agent will build for by browsing (it's the same connect dialog you get from the VS client).
Note that if you are using TFS 2012 Build Wizard on-premise (it's released now) it saves you from deploying a server :) At step 3, you point to a cloud hosted account # tfspreview.com, it will prompt you to authenticate and download the service account details for the build agent.
The 2012 wizard is covered here.

Resources