Build Agent keeps restarting after upgrade request from server - 2022.10.2
I have recently completed an upgrade from Teamcity 2020.2.3 to 2022.04.4 with no issues. A few days later I decided to take it to 2022.10.2 using the same upgrade method used before. The server upgrades just and I can access the console but the agents appear to be stuck in a constant cycle of upgrading. The agent goes through the process of downloading the new build agent, installing, register and then gets an update command sent to it from the server and the cycle repeats again. This continues indefinitely if not interrupted. This behaviour was not seen at all with 2022.04.4.
[2023-02-23 16:26:48,928] INFO - ldServer.AGENT.PollingProtocol - New command is received from server "upgrade" {id = 82853} (enable debug to see command body)
Please sign in to leave a comment.
Also specify how is the agent started (automatically or manually, which command and the arguments).
Hi Anatoly,
I have uploaded the files - the upload ID is 2023_02_24_edDUhfZSBPbGTwQrWspKRK.
upgrade.log
teamcity-agent.log
buildAgent.properties
teamcity-server.log
teamcity_agent_1
The agent was started manually using service teamcity_agent_1 start - an init.d wrapper to the usual agent.sh command. I have included that in the upload.
Thanks
Paul
Afternoon Anatoly,
No joy unfortunately. Config amended as follows
# grep temp /opt/teamcity/agent_1/conf/buildAgent.properties
## Container directory for the temporary directories.
tempDir=/opt/teamcity/agent_1/temp
Fresh set of logs uploaded as 2023_02_27_zCHAM7qRNzoj8uiBabpBH7.
Agent remains stcuk in an 'upgrade' cycle.
Ah yes, spectacular failure on my part there selecting the old logs.
Try again with 2023_02_27_29JiRGbq8tHehFvY3cGouU.
Two sets here - the first from 15:15 with the correct logs and config pathed to /opt/teamcity/agent_1/temp and the 2nd from after 16:15 with config set to ../temp.
Many thanks
Paul
```
workDir=../work
tempDir=../temp
systemDir=../system
```
Afternoon Anatoly,
What magic is this that you have proposed! I made the amendment and the agent registered straight away. I did the same for agent 2 and again it registered ok. I tried agent 3 with the original values and it failed to register.
Logs uploaded to 2023_03_08_21prBWperFne5M81642ndr
So it would seem it did not like a full path for the workDir, tempDir and systemDir. We previously tried amending tempDir so I presume the change to systemDir or workDir did the trick.
How very strange but thank you.
Kind regards
Paul
Afternoon Anatoly
Following up on your last comment the jar was in the expected place but the zip is in a slightly different place - see below.
[root@teamcityserver-clone teamcity]# locate agentSystemInfo.zip
/opt/teamcity/TeamCity/webapps/ROOT/WEB-INF/plugins/agentSystemInfo.zip
/opt/teamcity/TeamCity/webapps/ROOT/WEB-INF/plugins/.unpacked/agentSystemInfo/agent/agentSystemInfo.zip
[root@teamcityserver-clone teamcity]# locate agentSystemInfo.jar
/opt/teamcity/agent_1/plugins/agentSystemInfo/lib/agentSystemInfo.jar
/opt/teamcity/agent_2/plugins/agentSystemInfo/lib/agentSystemInfo.jar
/opt/teamcity/agent_3/plugins/agentSystemInfo/lib/agentSystemInfo.jar
As I mentioned in my previous comment however the upgrade is successful now following the use of relative paths in buildAgent.properties.
workDir=../work
tempDir=../temp
systemDir=../system
Kind regards
Paul