Server thinks agent is localhost

I am having issues connecting an agent to the server.  I am using TC 6.5 EAP.  The server is running on Windows and the agent is running on CentOS.  My agent properties file looks like this:


In the agent logs:

[2011-02-26 15:38:23,516]   INFO - buildServer.AGENT.registration - Registering on server http://tcserver.domain.local, AgentDetails{Name='', AgentId=10, BuildId=null, AgentAddress='', AlternativeAddresses=[], Port=9090, Version='17132', PluginsVersion='NA', AvailableRunners=[simpleRunner], AvailableVcs=[], AuthorizationToken=...snip...'}

In the server logs:

[2011-02-27 10:46:37,358]   INFO -   jetbrains.buildServer.SERVER - Agent tcagent1.domain.local has been registered with id 10, not running a build
[2011-02-27 10:46:52,104]   INFO -   jetbrains.buildServer.SERVER - Agent tcagent1.domain.local {id=10, host=}@4f98f2 has been unregistered. Reason: Cannot access agent

The agent is able to connect to the server just fine and I can authorize the agent on the server.  The problem is that the server thinks the address of the agent is, so it is never able to talk to it.  In the UI it is in the disconnected window:

  • Agent name: tcagent1.domain.local
  • Hostname/IP:
  • Port: 9090

I have tried manually removing the agent a numer of times and toggling a bunch of configuration settings, but without any luck.  The server continues to think the agent is on localhost.  Thanks.
Comment actions Permalink

Please check if you have reverse proxy on the server machine. This proxy may not set real agent IP to HTTP requiests that are sent to server.

Try to specify ownAddress and ownPort in file to disable auto-detection.

TeamCity requires two-way connection from agent to server. Please check you do not have firewalled port 9090 on agent machine.

Comment actions Permalink


1) No reverse proxy.
2) I am setting the ownAddress and ownPort in the file
3) I can telnet to port 9090 on the build agent from the build server

Any other thoughts? I put the agent log4j debug mode and see this in the RPC call:

    <param name="teamcity.agent.home.dir" value="/usr/share/TeamCity" />
    <param name="teamcity.agent.jvm.version" value="1.6.0_17" />
    <param name="teamcity.agent.launcher.version" value="17132" />
    <param name="" value="tcagent1.domain.local" />
    <param name="teamcity.agent.ownPort" value="9090" />
    <param name="" value="/usr/share/TeamCity/tools" />
    <param name="" value="/usr/share/TeamCity/work" />
    <param name="teamcity.serverUrl" value="http://tcserver.domain.local" />

It's obviously reading my config file, but it is not picking up the ownAddress property.
Comment actions Permalink

Please attach debug logs for the issue.

Comment actions Permalink

I've exactly the same problem with my agent installed on Mac OS X. Do you gave any suggestions, how can I resolve this problem?


Comment actions Permalink


Sorry for delay in answering.

TeamCity build agent and server uses two-way http communication. In most scenarios, server have a wellknown DNS name that you put to file to make agent connect to server.
Things are getting complicated for server to resolve build agent IP address.

If you specify ownAddress and ownPort parameters in TeamCity server will use them to connect to agent (don't forget to check firewall settings)

Otherwise, build agent reports the fill list of it's own IP addresses, server adds IP address from registration HTTP request. For each of those addresses server tries to ping build agent. address most likely to came from proxy, that is used between agent and server.

Note, there could be a not-easy-to-debug case when you have a build agent running locally (i.e. and another agent that is trying to connect through proxy. This could turn out server will try to ping agent on This meas server sends ping to another agent. To fix the issue you need to change ownPort settings from 9090 (default) to any other port.

Hope I shed light to the way Agent and Server communicate. Please let me know if you solve (or not) the issue


Please sign in to leave a comment.