Build agent authorized, hangs on upgrade

I have a TeamCity server hosted on Amazon EC2, and a Build Agent hosted on my home network with port 9090 forwarded from my home router to my PC. Installing the build agent works, and TeamCity recognizes it and allows me to authorize it.  Meanwhile the build agent says it needs to restart and upgrade.  That's where it hangs, with this text in the console window:

Registering on server, AgentDetails{Name='ANDARNO-CHEETAH',
AgentId=null, BuildId=null, AgentAddress='null', AlternativeAddresses=[192.168.
1.6,], Port=9090, Version='15772', PluginsVersion='0', AvailableRu
nners=[simpleRunner], AvailableVcs=[], AuthorizationToken='a254b0b02ae999a523996
[2010-12-20 18:01:05,587]   WARN - .amazon.agent.AmazonProperties - Fetched Amaz
on EC2 instance metadata does not contains required values. Probably this agent
was not started inside Amazon EC2. Is proxy server used?
Upgrade call received from the build server
Will upgrade when become idle
Registered: id:4, authorizationToken:a254b0b02ae999a523996b78fe1fe3ae
If this is the first time this agent registered on the server make sure it is au
thorized by administrator in the server web UI.


After the hang, in another console window I try to stop the build agent, and even that fails:

C:\BuildAgent\bin>agent stop
Received stop command from console.
Unable to locate agent port file: C:\BuildAgent\logs\buildAgent.port
Agent is not running?
Sending agent shutdown command to: http://localhost:9090
Failed to shutdown agent gracefully: Connection refused: connect

I've attached the contents of the buildagent\logs directory.

Can anyone please tell me why it's hanging and how I can correct it?


1 comment
Comment actions Permalink

Build agent does not hand, it was downloading update from the server. This may take some time depending on internet connection and hardware.
Please do the following:
- reboot machine/ensure there are no java processes running
- start machine again
- start/check build agent is started.
- wait till build agent download and apply upgrades. This could take up to 15 minutes.

As upgrade command received,
  - build agent shut itself down (i.e. write all the log messages you have seen),
  - than is starts to download update files from the server (this could take some time),
  - start upgrade java process
  - stop it's windows service/console (at that moment windows will report that build agent service is _not_ running)
  - upgrade process replaces all necessary files and starts new build agent instance (in the same way as is was running)

You may find upgrade.log file from the upgrade processes.

Please let me know if this procedure helped.


Please sign in to leave a comment.