After installing the TeamCity Agent onto a clean Windows Server 2022 install, it wouldn’t start
Windows could not start the TeamCity Build Agent service on Local Computer.
Error 1067: The process terminated unexpectedly.
- I had tried adding
TEAMCITY_JRE
to the environment variables with no luck - Didn’t matter whether as system service or custom account
The log in <agent-dir>binwrapper.log
has the clue
STATUS | wrapper | 2024/06/25 17:13:15 | --> Wrapper Started as Service
STATUS | wrapper | 2024/06/25 17:13:15 | Launching a JVM...
FATAL | wrapper | 2024/06/25 17:13:15 | Unable to execute Java command. The system cannot find the file specified. (0x2)
FATAL | wrapper | 2024/06/25 17:13:15 | "java" -Xrs -Xms16m -Xmx64m -Djava.library.path="../launcher/lib;../launcher/bin" -classpath "../launcher/lib/wrapper.jar;../launcher/lib/launcher.jar" -Dwrapper.key="VWZWhS5kGCLq5CfT" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=7056 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp jetbrains.buildServer.agent.StandAloneLauncher -ea -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Xrs -Dlog4j2.configurationFile=file:../conf/teamcity-agent-log4j2.xml -Dteamcity_logs=../logs/ -XX:+DisableAttachMechanism --add-opens=java.base/java.lang=ALL-UNNAMED -XX:+IgnoreUnrecognizedVMOptions jetbrains.buildServer.agent.AgentMain -file ../conf/buildAgent.properties
FATAL | wrapper | 2024/06/25 17:13:15 | Critical error: wait for JVM process failed
After adding the <agent-dir>jrebin
to the PATH
it worked