2

Agent push fails on windows, why is it failing?

I tried uninstalling JAVA on target , but had no luck. What could be causing the failure ?

[16:40:06]: [10.8.2.138] Installing TeamCity Build Agent Windows Service...
[16:40:06]: [10.8.2.138] TCBuildAgent
[16:40:06]: [10.8.2.138] Use 'TCBuildAgent' as new Windows Service  name
[16:40:07]: [10.8.2.138] wrapper | TeamCity Build Agent installed.
[16:40:07]: [10.8.2.138] New Service configuration info:
[16:40:07]: [10.8.2.138] [SC] QueryServiceConfig SUCCESS
[16:40:07]: [10.8.2.138] SERVICE_NAME: TCBuildAgent
[16:40:07]: [10.8.2.138] TYPE : 110 WIN32_OWN_PROCESS (interactive)
[16:40:07]: [10.8.2.138] START_TYPE : 2 AUTO_START
[16:40:07]: [10.8.2.138] ERROR_CONTROL : 1 NORMAL
[16:40:07]: [10.8.2.138] BINARY_PATH_NAME : C:\BuildAgent\launcher\bin\TeamCityAgentService-windows-x86-32.exe -s C:\BuildAgent\launcher\conf\wrapper.conf
[16:40:07]: [10.8.2.138] LOAD_ORDER_GROUP :
[16:40:07]: [10.8.2.138] TAG : 0
[16:40:07]: [10.8.2.138] DISPLAY_NAME : TeamCity Build Agent
[16:40:07]: [10.8.2.138] DEPENDENCIES :
[16:40:07]: [10.8.2.138] \Java\jre6\bin\java.exe"") was unexpected at  this time.
[16:40:07]: [10.8.2.138] SERVICE_START_NAME : LocalSystem
[16:40:07]: [10.8.2.138] Setup Java for TeamCity Build Agent Service...
[16:40:07]: [10.8.2.138] Non-zero exit code (255) from bin\install.bat
[16:40:07]: [10.8.2.138] Connecting to 10.8.2.138...
[16:40:07]: [10.8.2.138] Starting PSEXESVC service on 10.8.2.138...
[16:40:07]: [10.8.2.138] Connecting with PsExec service on 10.8.2.138...
[16:40:07]: [10.8.2.138] Copying C:\TeamCity\temp\___6151070313176408109\bootstrapper.exe to 10.8.2.138...
[16:40:07]: [10.8.2.138] Starting C:\TeamCity\temp\___6151070313176408109\bootstrapper.exe on 10.8.2.138...
[16:40:07]: [10.8.2.138] bootstrapper.exe exited on 10.8.2.138 with error code 255.
[16:40:07]: Remote agent installation failed: Command 'C:\TeamCity\temp\___8367585897317323465\cli-wrapper.exe C:\Users\svc_engbuild\.BuildServer\system\pluginData\psexec\psexec.exe /accepteula \\10.8.2.138 -e -h -u Myagent -p ********** -c -f C:\TeamCity\temp\___6151070313176408109\bootstrapper.exe bootstrap -u http://10.8.3.26/update/buildAgent.zip -- bin\install.bat http://10.8.3.26 C:\\BuildAgent 2926d23550b68e5603fe397f5cd8e38a' was executed with error message(s): Execution error. Return code=255
Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
CodeEmpower
  • 635
  • 1
  • 11
  • 29

2 Answers2

2

The base problem for this (in my case) was java being installed in the c:\program files (x86) directory. This seems to be a bug within the TeamCity agent install files and an issue has been already been raised with jetbrains - https://youtrack.jetbrains.com/issue/TW-42297.

My solution was to create a symbolic link from the c:\program files directory to the c:\program files (x86) directory. Here's the command:

mklink /d "c:\program files\java" "c:\program files (x86)\java"

I also had to create the environment variable JRE_HOME and set it to the new symlink C:\Program Files\Java\jre1.8.0_51".

Castrohenge
  • 8,525
  • 5
  • 39
  • 66
0

It only works with JDK, This is a bug in TeamCity. I removed JRE and installed JDK and now it works fine

CodeEmpower
  • 635
  • 1
  • 11
  • 29