Debugging disconnected build agents

I installed a build agent on a different box than my teamcity server (where a build agent runs fine). The new build agent is in a disconnected state and I'm trying to figure out how to make it connect.  My conjecture is that the new build agent is trying to apply upgrades and is failing.  I see several stack-traces in the upgrade.log like this, it's not clear to me what it's getting denied access to:

[2009-03-04 11:35:08,972]   INFO - .agent.run.ProcessOutputLogger - C:\BuildAgent\bin>..\launcher\bin\TeamCityAgentService-windows-x86-32.exe -t ../conf/wrapper.conf 
[2009-03-04 11:35:08,988]   INFO - .agent.run.ProcessOutputLogger - wrapper  | OpenSCManager failed - Access is denied. (0x5)
[2009-03-04 11:35:08,988]  ERROR - r.agent.upgrade.UpgradeRunBase - java.io.IOException: Failed to start process. Return code was 1 not equal to zero.
java.io.IOException: Failed to start process. Return code was 1 not equal to zero.
    at jetbrains.buildServer.agent.upgrade.UpgradeRunBase.runCmdLine(UpgradeRunBase.java:66)
    at jetbrains.buildServer.agent.upgrade.NTServiceUpgrade.exec(NTServiceUpgrade.java:36)
    at jetbrains.buildServer.agent.upgrade.NTServiceUpgrade.startAgain(NTServiceUpgrade.java:26)
    at jetbrains.buildServer.agent.upgrade.UpgradeRunBase.run(UpgradeRunBase.java:40)
    at jetbrains.buildServer.agent.upgrade.UpgradeMode$2.run(UpgradeMode.java:26)
    at jetbrains.buildServer.agent.upgrade.Upgrade2.main2(Upgrade2.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at jetbrains.buildServer.agent.ClazzLoader.call(ClazzLoader.java:59)
    at jetbrains.buildServer.agent.ClazzLoader.callMain2(ClazzLoader.java:19)
    at jetbrains.buildServer.agent.upgrade.Upgrade.main(Upgrade.java:16)

And the following in the teamcity-agent.log suggests that the upgrade failure is causing the agent to shutdown:

[2009-03-04 11:28:40,366]   INFO - rocesses.ProcessTreeTerminator - No processes to kill
[2009-03-04 11:28:40,366]   INFO -    jetbrains.buildServer.AGENT - Exit for upgrade
[2009-03-04 11:28:40,366]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent start
[2009-03-04 11:28:40,366]   INFO -    jetbrains.buildServer.AGENT - Unregistering from build server: 2
[2009-03-04 11:28:40,381]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent WebServer start
[2009-03-04 11:28:40,381]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent WebServer finish
[2009-03-04 11:28:40,381]   INFO -    jetbrains.buildServer.AGENT - Shutdown agent finish

I've also verified that there's no firewall blocking the port on the build-agent side (port 9090).  I don't know how the build-agent communicates with the server though, so I don't know what port to verify for that line of communication.  Can someone help me to track down the ports I can verify for that?  I don't think that's the problem but I want to be sure.

Thanks,

--kov

2 comments
Comment actions Permalink

[2009-03-04 11:35:08,988]   INFO - .agent.run.ProcessOutputLogger - wrapper  | OpenSCManager failed - Access is denied. (0x5)

It seems the user account under which the build agent service is running does not have enough permissions to update itself via the windows services API. Try to use different user account which has more permissions.

0
Comment actions Permalink

Thanks, Pavel.  Yes, I stopped the service, made the user and administrator and restarted the service.  Eventually, it succeeded in upgrading itself and connected.

Ideally, though, I'd like a better idea what privileges it lacked so that it doesn't have to run with admin privileges.

0

Please sign in to leave a comment.