Remote agent doesn't connect to server

Welcome,
I'm using TeamCity as CI for about 2 months in configuration:
- Windows Server 2008 with TeamCity 6.5.3 (server + agent)
- Mac OSX 10.7.1 (agent)
Generally everything did work ok, but few days ago suddenly occurred some problem which I'm not able to resolve. At this moment server and agent on Windows machine work, but agent on Mac doesn't connect to my server and completely isn't possible use it as build machine. Sometimes I see it for few seconds in connected tab (with exclamation icon), but after that agent back to unconnected tab.
After some log investigation I see, that server try to authorize remote agent with host set to 127.0.0.1, but computer with Mac OSX has assigned IP 192.168.1.103.

[2011-10-06 22:55:17,468]   INFO -   jetbrains.buildServer.SERVER - Agent MacBook has been registered with id 2, not running a build
[2011-10-06 22:55:27,343]   INFO -   jetbrains.buildServer.SERVER - Agent MacBook {id=2, host=127.0.0.1:9090}@12b25db has been unregistered. Reason: Cannot access agent
[2011-10-06 22:58:23,967]   INFO -   jetbrains.buildServer.SERVER - Agent MacBook has been registered with id 2, not running a build
[2011-10-06 22:58:32,281]   INFO -   jetbrains.buildServer.SERVER - Agent MacBook {id=2, host=127.0.0.1:9090}@efdf29 has been unregistered. Reason: Cannot access agent


In the same time in agent logs are placed:

[2011-10-06 22:58:12,876]   INFO -    jetbrains.buildServer.AGENT - Recieved stop command from launcher
[2011-10-06 22:58:12,877]   INFO -    jetbrains.buildServer.AGENT - Stop command was not performed. No build to stop with reason: BuildInterruptReason.AGENT_SHUTDOWN
[2011-10-06 22:58:12,877]   INFO -    jetbrains.buildServer.AGENT - Starting agent shutdown sequence, reason: Stop command called
[2011-10-06 22:58:12,884]   INFO - agent.impl.AgentPortFileWriter - Delete agent runtime file from /Applications/buildAgent/logs/buildAgent.port
[2011-10-06 22:58:12,885]   INFO -    jetbrains.buildServer.AGENT - Unregistering from build server: 2
[2011-10-06 22:58:12,896]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent WebServer start
[2011-10-06 22:58:12,919]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent WebServer finish
[2011-10-06 22:58:12,919]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent finish
[2011-10-06 22:58:12,920]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent agent and exit with code DIE_USER_COMMAND
[2011-10-06 22:58:12,922]   INFO - buildServer.agent.AgentMain2$1 - Closing jetbrains.buildServer.agent.AgentMain2$1@779b04e2: display name [jetbrains.buildServer.agent.AgentMain2$1@779b04e2]; startup date [Thu Oct 06 22:49:13 CEST 2011]; root of context hierarchy
[2011-10-06 22:58:21,709]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity agent
[2011-10-06 22:58:21,710]   INFO - s.buildServer.agent.AgentMain2 -
[2011-10-06 22:58:21,710]   INFO - s.buildServer.agent.AgentMain2 - ===========================================================
[2011-10-06 22:58:21,715]   INFO - s.buildServer.agent.AgentMain2 - TeamCity Build Agent 6.5.2 (build 17935)
[2011-10-06 22:58:21,715]   INFO - s.buildServer.agent.AgentMain2 - Starting...
[2011-10-06 22:58:21,720]   INFO - s.buildServer.agent.AgentMain2 - Agent home is /Applications/buildAgent
[2011-10-06 22:58:21,768]   INFO - buildServer.agent.AgentMain2$1 - Refreshing jetbrains.buildServer.agent.AgentMain2$1@625dcec6: display name [jetbrains.buildServer.agent.AgentMain2$1@625dcec6]; startup date [Thu Oct 06 22:58:21 CEST 2011]; root of context hierarchy
[2011-10-06 22:58:22,432]   INFO - buildServer.agent.AgentMain2$1 - Bean factory for application context [jetbrains.buildServer.agent.AgentMain2$1@625dcec6]: org.springframework.beans.factory.support.DefaultListableBeanFactory@654df764
[2011-10-06 22:58:23,281]   WARN -    jetbrains.buildServer.AGENT - Calculating CPU benchmark index...
[2011-10-06 22:58:31,898]   WARN -    jetbrains.buildServer.AGENT - CPU benchmark index is set to 364
[2011-10-06 22:58:31,988]   INFO - rver.plugins.PluginManagerImpl - ===========================================================
[2011-10-06 22:58:31,989]   INFO - rver.plugins.PluginManagerImpl - Scanning plugins folders
[2011-10-06 22:58:31,990]   INFO - .plugins.files.JarSearcherBase - Scanning plugin folder: /Applications/buildAgent/plugins
[2011-10-06 22:58:31,990]   INFO - .plugins.files.JarSearcherBase - Scanning plugin folder: /Applications/buildAgent/tools
[2011-10-06 22:58:31,991]   INFO - rver.plugins.PluginManagerImpl - Found 0 plugins: []
[2011-10-06 22:58:31,991]   INFO - rver.plugins.PluginManagerImpl - Start intializing plugins...
[2011-10-06 22:58:31,991]   INFO - rver.plugins.PluginsCollection - No plugins were loaded with standalone classloaders
[2011-10-06 22:58:31,991]   INFO - rver.plugins.PluginsCollection - Load shared classloader for 0 plugins []
[2011-10-06 22:58:31,994]   INFO - rver.plugins.PluginManagerImpl - Loaded 0 plugins: []
[2011-10-06 22:58:31,995]   INFO - rver.plugins.PluginManagerImpl - ===========================================================
[2011-10-06 22:58:31,999]   INFO -    jetbrains.buildServer.AGENT - Loading agent versions file from: /Applications/buildAgent/system/.teamcity-agent/teamcity-agent.xml
[2011-10-06 22:58:31,999]   WARN -    jetbrains.buildServer.AGENT - Agent versions file does not exist: /Applications/buildAgent/system/.teamcity-agent/teamcity-agent.xml
[2011-10-06 22:58:31,999]   INFO -    jetbrains.buildServer.AGENT - Build Agent version: 17935, plugins signature: NA
[2011-10-06 22:58:32,025]   INFO - rectories.DirectoryCleanerImpl - Cannot locate .old for path '/Applications/buildAgent/temp/cache'. Deleting files in place.
[2011-10-06 22:58:32,026]   INFO -    jetbrains.buildServer.AGENT - Start build agent
[2011-10-06 22:58:32,064]   INFO -    jetbrains.buildServer.AGENT - Agent Web server started
[2011-10-06 22:58:32,067]   INFO - agent.impl.AgentDetailsFactory - Build agent ownAddress will be defined by the server. Define 'ownAddress' property in the conf/buildAgent.properties file
[2011-10-06 22:58:32,075]   INFO - agent.impl.AgentPortFileWriter - Writing agent runtime file to /Applications/buildAgent/logs/buildAgent.port
[2011-10-06 22:58:32,075]   INFO - agent.impl.AgentPortFileWriter - Launcher version is 17935
[2011-10-06 22:58:32,076]   INFO - agent.impl.AgentPortFileWriter - Writing agent runtime file to /Applications/buildAgent/logs/buildAgent.port :DONE!
[2011-10-06 22:58:32,076]   INFO -    jetbrains.buildServer.AGENT - Build agent started
[2011-10-06 22:58:32,078]   INFO - buildServer.AGENT.registration - Registering on server http://xxxxxxxxxxx.com, AgentDetails{Name='MacBook', AgentId=null, BuildId=null, AgentAddress='null', AlternativeAddresses=[192.168.1.103, 5.11.217.133], Port=9090, Version='17935', PluginsVersion='NA', AvailableRunners=[simpleRunner], AvailableVcs=[], AuthorizationToken='e0f8d362a37c47bba83b76b8ca810d6b'}
[2011-10-06 22:58:32,415]   INFO - buildServer.AGENT.registration - Registered: id:2, authorizationToken:e0f8d362a37c47bba83b76b8ca810d6b
[2011-10-06 22:58:32,415]   INFO - buildServer.AGENT.registration - If this is the first time this agent registered on the server make sure it is authorized by administrator in the server web UI.


In agent summary tab I seen only:

  • Agent name: MacBook
  • Hostname/IP: 127.0.0.1
  • Port: 9090

Normally here were placed more details about agent's machine.

In file buildAgent.port is placed:

#Do not edit this file!
#Thu Oct 06 22:58:32 CEST 2011
agentXmlRpc=http\://localhost\:9090
launcher.version=17935



I've tried to reinstall remote agent on Mac OSX, but without any success. Has anyone any suggestions how can I resolve this problem? I will be very gratefully for some hints how can I alive my BuildAgent on Mac OSX.

Regards,
Grzegorz

3 comments
Comment actions Permalink

Hi all,
Has anyone any suggestions how can I resolve my problem. Maybe some had similar problem and can share some advice? This issue is very irritating for me, because my projects targeted to Mac OSX couldn't be built by TeamCity so process of CI doesn't work at all.

Regards,
Grzegorz

0
Comment actions Permalink

OK, I've found solution to my problem.
I've to specify in file buildAgent.properies my IP address:
ownAddress=193.168.1.103

Now it looks, that everything works proper.

Regards,
Grzegorz

1

Please sign in to leave a comment.