Agent has unregistered (will upgrade) -- never starts again
I have just installed version 9.1.6 of IntelliJ (required for compatibility with old build configurations and licences).
When I start the agent, it does the usual thing of attempting to upgrade itself. It gets to the point of shutting down, with the above message, but I never see it start again. I have left it for > 12 hours.
The build agent is running on the same machine as the build server. This is all installed on OSX:
ProductName: Mac OS X
ProductVersion: 10.11.5
BuildVersion: 15F34
I start the server and the agent using the shell scripts (teamcity-server.sh and agent.sh)
I cannot see any errors in the logs. But I have noticed that there is still an agent running after it says it will shutdown.
$ ps ax | grep agent
3397 ?? S 1:07.48 /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java -ea -cp ../launcher/lib/launcher.jar jetbrains.buildServer.agent.Launcher -ea -Xmx384m -Dteamcity_logs=../logs/ -Dlog4j.configuration=file:../conf/teamcity-agent-log4j.xml jetbrains.buildServer.agent.AgentMain -file ../conf/buildAgent.properties
I expected to see an upgrade.log in the agent's log directory, but it is not there. It seems like the upgrade process is just failing to start.
What else can I try?
Please sign in to leave a comment.
I couldn't work out why it never completed, but I did find in the output.log file, this:
Starting new process with command line ('|' arguments separator): /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/bin/java|-classpath|/Users/user/TeamCity/agents/agent1/update/launcher/lib/launcher.jar|jetbrains.buildServer.agent.upgrade.Upgrade|SH|/Users/user/TeamCity/agents/agent1|-ea|-Xmx384m|-Dteamcity_logs=../logs/|-Dlog4j.configuration=file:../conf/teamcity-agent-log4j.xml|jetbrains.buildServer.agent.AgentMain|-file|../conf/buildAgent.properties| in directory: /Users/user/TeamCity/agents/agent1
Launcher is waiting to be killed by upgrade process
I then recreated that command (replacing '|' with ' ') and ran it in the correct directory. Then the agent reconnected and all is well.
/Raymond
I am having the same problem here
I am installing 9.1.3 teamcity server/agent on centos 7; i am using systemd for the teamcity daemon, the agent:
Unit]
Description=teamcity-agent systemd service
After=network.target
[Service]
Type=simple
User=teamcity
Group=teamcity
PIDFile=/home/TC/src/9.1.3/buildAgent/logs/buildAgent.pid
ExecStart=/home/TC/src/9.1.3/buildAgent/bin/agent.sh start
ExecStop=/home/TC/src/9.1.3/buildAgent/bin/agent.sh stop
SuccessExitStatus=1
RestartSec=5
[Install]
WantedBy=multi-user.target
output.log
[2017-07-10 13:36:59.517] If this is the first time this agent registered on the server make sure it is authorized by administrator in the server web UI.
Exit for upgrade
Upgrade process
Agent process finished
Agent has exited with code: 10
Updates directory exists
Update files check succeeded
Current Java runtime version is 1.8
Starting new process with command line ('|' arguments separator): /usr/lib/jvm/jdk1.8.0_131/jre/bin/java|-classpath|/home/TC/src/9.1.3/buildAgent/update/launcher/lib/launcher.jar|jetbrains.buildServer.agent.upgrade.Upgrade|SH|/home/TC/src/9.1.3/buildAgent|-ea|-Xmx384m|-Dteamcity_logs=../logs/|-Dlog4j.configuration=file:../conf/teamcity-agent-log4j.xml|jetbrains.buildServer.agent.AgentMain|-file|../conf/buildAgent.properties| in directory: /home/TC/src/9.1.3/buildAgent
Launcher is waiting to be killed by upgrade process
I did exactly what Raymond suggested, recreated that command (replacing '|' with ' ') and ran it in the correct directory my agent is then reconnected and registered correctly