Disconnected (Agent has unregistered (will upgrade))

I've setup and used a few TeamCity servers so far mostly having no issues. Now I've ran into an issue with Build Agent not registering/connecting itself to the server. The message in TC admin is: "
Disconnected (Agent has unregistered (will upgrade)), last communication date 27 Dec 12 01:49". This has remained displayed for the whole day today. I tried manually restarting the Windows TC BA service with no difference.



I have this server running on Windows Server 2008 R2 x64 and it's running on a port of 8090, while BA is using 9090.


This is from the build agent log:


[2012-12-27 01:49:37,174] INFO - jetbrains.buildServer.AGENT - Build Agent version: 24266, plugins signature: NA
[2012-12-27 01:49:37,201] INFO - jetbrains.buildServer.AGENT - Start build agent
[2012-12-27 01:49:37,228] INFO - jetbrains.buildServer.AGENT - Agent Web server started
[2012-12-27 01:49:37,229] INFO - agent.impl.AgentDetailsFactory - Build agent ownAddress will be defined by the server. Define 'ownAddress' property in the conf/buildAgent.properties file
[2012-12-27 01:49:37,230] INFO - ctories.CleanupRegistryCleaner - Removing files from .old to meet free space requirements.
[2012-12-27 01:49:37,241] INFO - l.directories.DirectoryMapImpl - Cleaning up old checkout directories. Default lifetime = 192 hour(s)
[2012-12-27 01:49:37,243] INFO - agent.impl.AgentPortFileWriter - Writing agent runtime file to c:\TeamCity\buildAgent\bin\..\logs\buildAgent.port
[2012-12-27 01:49:37,243] INFO - agent.impl.AgentPortFileWriter - Launcher version is 24266
[2012-12-27 01:49:37,244] INFO - agent.impl.AgentPortFileWriter - Writing agent runtime file to c:\TeamCity\buildAgent\bin\..\logs\buildAgent.port :DONE!
[2012-12-27 01:49:37,244] INFO - jetbrains.buildServer.AGENT - Build agent started
[2012-12-27 01:49:37,247] INFO - buildServer.AGENT.registration - Registering on server http://localhost:8090, AgentDetails{Name='FOX', AgentId=null, BuildId=null, AgentOwnAddress='null', AlternativeAddresses=[172.16.0.11, 172.16.0.10], Port=9090, Version='24266', PluginsVersion='NA', AvailableRunners=[], AvailableVcs=[], AuthorizationToken='c700290ea42ad9394c4d3f77d4ac34ad'}
[2012-12-27 01:49:37,635] INFO - jetbrains.buildServer.AGENT - Upgrade call received from the build server
[2012-12-27 01:49:37,635] INFO - jetbrains.buildServer.AGENT - Will upgrade when become idle
[2012-12-27 01:49:37,636] INFO - jetbrains.buildServer.AGENT - Wait for agent registration to finish
[2012-12-27 01:49:37,660] INFO - ctories.CleanupRegistryCleaner - Removing files from .old to meet free space requirements.
[2012-12-27 01:49:37,686] INFO - buildServer.AGENT.registration - Registered: id:1, authorizationToken:c700290ea42ad9394c4d3f77d4ac34ad
[2012-12-27 01:49:37,686] 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.
[2012-12-27 01:49:37,687] INFO - jetbrains.buildServer.AGENT - Agent registration finished.
[2012-12-27 01:49:37,688] INFO - jetbrains.buildServer.AGENT - Stop command was not performed. No build to stop with reason: BuildInterruptReason.AGENT_SHUTDOWN
[2012-12-27 01:49:37,688] INFO - jetbrains.buildServer.AGENT - Starting agent shutdown sequence, reason: Restart agent, failed to download upgrade from server
[2012-12-27 01:49:37,692] INFO - jetbrains.buildServer.AGENT - Host configuration for downloading updates: HostConfiguration[host=http://localhost:8090]
[2012-12-27 01:49:37,692] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/teamcity-agent.xml ==> C:\TeamCity\buildAgent\temp\2pC048rqYGmiNTuo5uo6u32fn3MtjMer
[2012-12-27 01:49:37,716] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/agentSystemInfo.zip ==> C:\TeamCity\buildAgent\update\plugins\agentSystemInfo.zip
[2012-12-27 01:49:37,737] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/amazonEC2.zip ==> C:\TeamCity\buildAgent\update\plugins\amazonEC2.zip
[2012-12-27 01:49:37,769] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/ant.zip ==> C:\TeamCity\buildAgent\update\plugins\ant.zip
[2012-12-27 01:49:38,183] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/antPlugin.zip ==> C:\TeamCity\buildAgent\update\plugins\antPlugin.zip
[2012-12-27 01:49:38,200] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/assembly-info-patcher.zip ==> C:\TeamCity\buildAgent\update\plugins\assembly-info-patcher.zip
[2012-12-27 01:49:38,215] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/clearcase-agent.zip ==> C:\TeamCity\buildAgent\update\plugins\clearcase-agent.zip
[2012-12-27 01:49:38,225] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/commandLineRunner.jar ==> C:\TeamCity\buildAgent\update\plugins\commandLineRunner.jar
[2012-12-27 01:49:38,240] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/coveragePlugin.zip ==> C:\TeamCity\buildAgent\update\plugins\coveragePlugin.zip
[2012-12-27 01:49:38,296] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/crashDetector.zip ==> C:\TeamCity\buildAgent\update\plugins\crashDetector.zip
[2012-12-27 01:49:38,319] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/cvsAgent.zip ==> C:\TeamCity\buildAgent\update\plugins\cvsAgent.zip
[2012-12-27 01:49:38,654] INFO - jetbrains.buildServer.AGENT - Downloading http://localhost:8090/update/plugins/dotCover.zip ==> C:\TeamCity\buildAgent\update\plugins\dotCover.zip
[2012-12-27 01:49:39,230] INFO - jetbrains.buildServer.AGENT - Updating agent parameters on the server: AgentDetails{Name='FOX', AgentId=1, BuildId=null, AgentOwnAddress='null', AlternativeAddresses=[172.16.0.11, 172.16.0.10], Port=9090, Version='24266', PluginsVersion='NA', AvailableRunners=[], AvailableVcs=[], AuthorizationToken='c700290ea42ad9394c4d3f77d4ac34ad'}
[2012-12-27 01:49:39,244] INFO - agent.impl.AgentPortFileWriter - Delete agent runtime file from c:\TeamCity\buildAgent\bin\..\logs\buildAgent.port
[2012-12-27 01:49:39,245] INFO - jetbrains.buildServer.AGENT - Unregistering from build server: 1
[2012-12-27 01:49:39,249] INFO - jetbrains.buildServer.AGENT - Shutdown agent WebServer start
[2012-12-27 01:49:39,250] INFO - jetbrains.buildServer.AGENT - Shutdown agent WebServer finish
[2012-12-27 01:49:39,250] INFO - jetbrains.buildServer.AGENT - Shutdown agent finish
Please note the following line:
[2012-12-27 01:49:37,688] INFO - jetbrains.buildServer.AGENT - Starting agent shutdown sequence, reason: Restart agent, failed to download upgrade from server


Something is blocking agent's connections to the server but it's not firewall or AV (I disabled everything to test).


Another strange behaviour is that I cannot download neither Java Web Start for agents or Microsoft installer - both start but stay at 0% - this is very strange, it should be immediately at 100% since its localhost. It is not the IE ESC because it's disabled also. If I try to download any of the above plugin packages manually in the browser it also doesn't work (goes to like 11% and then stops).


I tried removing the TC installation completely, starting a new installation with DB recreation and it didn't help.


I really thought it would be firewall misconfiguration and after few unsuccessful repair attempts I just disabled it and the behaviour was still the same.


running TC version 7.1.3 (build 24266)


Any ideas?

1 comment
Comment actions Permalink

I can now confirm that this was an issue with AV, specifically ESET NOD32 Antivirus (and old version of it). What made this hard to troubleshoot was the fact that AV was blocking the downloads (agent upgrades) even after it was disabled completely (realtime scanning and protection disabled). After hours of trying to find out what is wrong and another installation on a brand new Windows Server 2008 R2 machine (where everything worked) I decided to uninstall the AV completely and things started to work immediately. I then installed a new version of AV (the ESET File Security for Windows Server) and things still worked so that's the configuration now.

So if you run into issues with agent not upgrading try to remove the AV first and then troubleshoot further.

HTH

0

Please sign in to leave a comment.