Michael Sync

Michael Sync

Crisp, minimal personal blog

29 Oct 2013

TeamCity: Unable to connect the build agent?


It seems like we have a different problem every day. I was opening up the CI (TeamCity) site to public access so I did a bit of changes in Build agent configuration and TeamCity server configuration. After that, I am not able to connect the build agent from Teamcity server.

Disconnected TeamCity Build Agent

Are you also having the same problem?

If yes then the first thing that you should check is the teamcity-agent.log file which is located under C:\BuildAgent\logs folder.

[2013-10-29 14:29:41,264] INFO – buildServer.AGENT.registration – Registering on server http:://localhost:5534, AgentDetails{Name=‘my-agent-name’, AgentId=null, BuildId=null, AgentOwnAddress=‘null’, AlternativeAddresses=[100.90.98.83], Port=9090, Version=‘27540′, PluginsVersion=‘27540-md5-5b7544cdf3432ba89ca2a172e2a1e21f’, AvailableRunners=[Ant, dotnet-tools-dupfinder, dotnet-tools-inspectcode, Duplicator, FxCop, gradle-runner, Inspection, Ipr, jb.nuget.installer, jb.nuget.pack, jb.nuget.publish, jetbrains.dotNetGenericRunner, jetbrains.mspec, jetbrains_powershell, JPS, Maven2, MSBuild, MSTest, NAnt, NUnit, rake-runner, simpleRunner, sln2003, VS.Solution], AvailableVcs=[perforce, mercurial, jetbrains.git, tfs, svn, cvs], AuthorizationToken=‘c’}

[2013-10-29 14:29:41,312] WARN – buildServer.AGENT.registration – Call http:://localhost:5534/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcClientException: Unexpected exception in client processing

[2013-10-29 14:29:41,313] WARN – buildServer.AGENT.registration – Connection to TeamCity server is probably lost. Will be trying to restore it. Take a look at logs/teamcity-agent.log for details (unless you’re using custom logging).

Do you see the error? Yes. There is two colons (http::localhost) in URL. You can open up the buildAgent.properties file under C:\BuildAgent\conf.

Here is the most typical buildAgent.properties file look like. After that, you can restart the “Team City Build Agent” service.

#Generated properties (see buildAgent.dist.properties for description) #Tue Oct 29 14:17:24 UTC 2013 name=my-agent-name ownPort=9090 serverUrl=http://localhost:5534 workDir=C:\BuildAgent\work tempDir=C:\BuildAgent\temp #User defined properties #Tue Oct 29 14:17:24 UTC 2013 authorizationToken=c05cf77775ac4fb52321b3f23f66e882 env.TEAMCITY_JRE=C:\BuildAgent\jre