New 9.1 installation; agents unable to connect to server

I have two new Windows Server 2012 VMs, one with TeamCity 9.1, and the other with a build agent. These are freshly installed and configured. I am getting exceptions when the agent attempts to register with TeamCity, and have not found a way to find and resolve the root cause.

I'm not sure where to look for more information, but here are the relevant logs that I know of already:

wrapper.log (Agent VM)

INFO   | jvm 1    | 2015/07/22 15:24:12 | [2015-07-22 15:24:12,093]   WARN - .agent.AmazonPropertiesUpdater - Fetched Amazon EC2 instance metadata does not contain required values. Probably this agent was not started inside Amazon EC2. Is proxy server used?  
INFO   | jvm 1    | 2015/07/22 15:24:12 | Registering on server https://dev-build.REDACTED.com, AgentDetails{Name='TeamCity Build Agent 1', AgentId=null, BuildId=null, AgentOwnAddress='null', AlternativeAddresses=[10.28.16.58], Port=9091, Version='36973', PluginsVersion='NA', AvailableRunners=[], AvailableVcs=[], AuthorizationToken='', PingCode='REDACTED'}
INFO   | jvm 1    | 2015/07/22 15:24:13 | [2015-07-22 15:24:13,140]   WARN - buildServer.AGENT.registration - Call https://dev-build.REDACTED.com/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: For input string: "49183:9091"  
INFO   | jvm 1    | 2015/07/22 15:24:13 | Call https://dev-build.REDACTED.com/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: For input string: "49183:9091"
INFO   | jvm 1    | 2015/07/22 15:24:13 | [2015-07-22 15:24:13,140]   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).  
INFO   | jvm 1    | 2015/07/22 15:24:16 | Registering on server https://dev-build.REDACTED.com, AgentDetails{Name='TeamCity Build Agent 1', AgentId=null, BuildId=null, AgentOwnAddress='null', AlternativeAddresses=[10.28.16.58], Port=9091, Version='36973', PluginsVersion='NA', AvailableRunners=[], AvailableVcs=[], AuthorizationToken='', PingCode='REDACTED'}
INFO   | jvm 1    | 2015/07/22 15:24:16 | Call https://dev-build.REDACTED.com/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: For input string: "49183:9091"
INFO   | jvm 1    | 2015/07/22 15:24:19 | Registering on server https://dev-build.REDACTED.com, AgentDetails{Name='TeamCity Build Agent 1', AgentId=null, BuildId=null, AgentOwnAddress='null', AlternativeAddresses=[10.28.16.58], Port=9091, Version='36973', PluginsVersion='NA', AvailableRunners=[], AvailableVcs=[], AuthorizationToken='', PingCode='REDACTED'}
INFO   | jvm 1    | 2015/07/22 15:24:19 | Call https://dev-build.REDACTED.com/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: For input string: "49183:9091"

teamcity-agent.log (Agent VM)

[2015-07-22 15:34:31,313]   INFO - buildServer.AGENT.registration - Server supports the following protocols: [xml-rpc, polling]
[2015-07-22 15:34:31,313]   INFO - buildServer.AGENT.registration - Trying to register using 'xml-rpc' protocol.
[2015-07-22 15:34:31,501]   WARN - buildServer.AGENT.registration - Call https://dev-build.REDACTED.com/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: For input string: "49256:9091"
[2015-07-22 15:34:31,501]   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).

teamcity-server.log (Server VM)

[2015-07-22 15:38:54,575]   WARN -   jetbrains.buildServer.SERVER - Failed to resolve agent address: 10.28.16.58:49183, error: java.net.UnknownHostException: 10.28.16.58:49183: invalid IPv6 address
[2015-07-22 15:38:57,762]   WARN -   jetbrains.buildServer.SERVER - Failed to resolve agent address: 10.28.16.58:49183, error: java.net.UnknownHostException: 10.28.16.58:49183: invalid IPv6 address
[2015-07-22 15:39:00,841]   WARN -   jetbrains.buildServer.SERVER - Failed to resolve agent address: 10.28.16.58:49183, error: java.net.UnknownHostException: 10.28.16.58:49183: invalid IPv6 address
[2015-07-22 15:39:03,934]   WARN -   jetbrains.buildServer.SERVER - Failed to resolve agent address: 10.28.16.58:49183, error: java.net.UnknownHostException: 10.28.16.58:49183: invalid IPv6 address


I'm not sure why these errors indicate IPv6. I've checked firewall and other network settings to ensure that the two servers can communicate with one another, though this is obviouc since the Agent registration RPCs are showing in the server log above. Both systems are running the latest 1.8 JRE as well.

Server is on 10.28.16.56. Agent is on 10.28.16.58 and is using port 9091.

Edit: Another observation. I reinstalled the server and included a local Build Agent. This agent successfully configured itself with the server and came online. Whatever is causing the server to think that 10.28.16.58 is IPv6 (and failing) apparently is not affected 127.0.0.7

Any ideas on what could be causing the java.lang.RuntimeException, how to find more details on this, or any suggestions in general?

3 comments
Comment actions Permalink

Leaving this all here for anyone with future issues. I'm not sure what underlying system or network configuration caused this, but the agent was self-detecting its IP address incorrected.

By adding the following configuration line I was able to get the agent to communicate with the server:

buildAgent.properties (Agent VM)

ownAddress=10.28.16.58

Hopefully this is useful to someone else, or maybe there's an explanation for what could have been configured on a Windows Server 2012 VM to make this happen,

0
Comment actions Permalink

Hi Jason,

Here is the bug in TeamCity 9.1 https://youtrack.jetbrains.com/issue/TW-41837, please watch the issue. We are going to fix it ASAP.

0
Comment actions Permalink

Hi Jason,

It will be great if you help us to investigate this issue - please remove 'ownAddress' from agent's properties, enable DEBUG logging on agent and server and send us both teamcity-server.log and teamcity-agent.log. If you want, you can attach logs to the issue with visibility to jetbrains team only.

1

Please sign in to leave a comment.