Failed to Upgrade Agent Windows Server 2008 R2 Datacenter

I'm having issues upgrading a teamcity build agent on a virtualized  Windows Server 2008 R2 Datacenter.  I have specified the correct Windows  service account upon installation and can also login to the account to  verify permissions and the ability to start/stop service.  I can even  run the exact line in the log with no issues.  The error part of the  upgrade log is below:

[2012-01-11 09:07:16,732]  DEBUG - agent.upgrade.NTServiceUpgrade - Service name is TCBuildAgent
[2012-01-11 09:07:16,732]   INFO - r.agent.upgrade.UpgradeRunBase - Run  command line (arguments separated with '|'):  cmd.exe|/c|net.exe|start|TCBuildAgent| (at C:\BuildAgent\bin)
[2012-01-11 09:07:16,873]   WARN - .agent.run.ProcessOutputLogger - System error 5 has occurred.
[2012-01-11 09:07:16,873]   WARN - .agent.run.ProcessOutputLogger -  
[2012-01-11 09:07:16,873]   WARN - .agent.run.ProcessOutputLogger - Access is denied.
[2012-01-11 09:07:16,873]   WARN - .agent.run.ProcessOutputLogger -  
[2012-01-11 09:07:16,889]  DEBUG - agent.upgrade.NTServiceUpgrade -  Failed to start TeamCity build agent Windows service during agent  upgrade: net.exe start TCBuildAgent. Please check TeamCity agent Windows  service user have enough permissions to stop and start the  service.Failed to start process. Return code was 2 not equal to zero.
[2012-01-11 09:07:16,889]   INFO - r.agent.upgrade.UpgradeRunBase - Run  command line (arguments separated with '|'):  cmd.exe|/c|service.start.bat| (at C:\BuildAgent\bin)
[2012-01-11 09:07:16,951]   INFO - .agent.run.ProcessOutputLogger -  
[2012-01-11 09:07:16,951]   INFO - .agent.run.ProcessOutputLogger -  C:\BuildAgent\bin>..\launcher\bin\TeamCityAgentService-windows-x86-32.exe  -t ../conf/wrapper.conf  
[2012-01-11 09:07:16,982]   INFO - .agent.run.ProcessOutputLogger - wrapper  | OpenSCManager failed - Access is denied. (0x5)
[2012-01-11 09:07:16,998]  ERROR - r.agent.upgrade.UpgradeRunBase -  Failed to start agent after upgrade: java.io.IOException: Failed to  start/stop TeamCity agent Windows service during agent upgrade: Error  while executing command 'service.start.bat'. Please check TeamCity agent  Windows service user have enough permissions to stop and start the  service.Failed to start process. Return code was 1 not equal to zero.
java.io.IOException: Failed to start/stop TeamCity agent Windows service  during agent upgrade: Error while executing command  'service.start.bat'. Please check TeamCity agent Windows service user  have enough permissions to stop and start the service.Failed to start  process. Return code was 1 not equal to zero.
     at jetbrains.buildServer.agent.upgrade.NTServiceUpgrade.exec(NTServiceUpgrade.java:56)
     at jetbrains.buildServer.agent.upgrade.NTServiceUpgrade.startAgain(NTServiceUpgrade.java:47)
     at jetbrains.buildServer.agent.upgrade.UpgradeRunBase.run(UpgradeRunBase.java:50)
     at jetbrains.buildServer.agent.upgrade.UpgradeMode$2.run(UpgradeMode.java:28)
     at jetbrains.buildServer.agent.upgrade.Upgrade2.main2(Upgrade2.java:34)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     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)

1 comment
Comment actions Permalink

Hi Jeffrey

Your agent is started under non-administrative account, right?
We fixed this issue in 6.5.5.
As workaround, you can change service.stop.bat and service.start.bat files as described in the issue, or reinstall the agent completely.

Michael

0

Please sign in to leave a comment.