Symptoms
- A new agent starts from a cloud profile.
- It registers on the server with a
-1suffix in its name. Example:Private - Amazon Linux 2023-i-0abc123-1. - The agent is not being automatically authorized and appears in the list of Unauthorized agents on the Agents page.
Cause
This behavior can occur in the following scenario:
- After the agent is created and connects to the server for the first time, it receives an authentication token and is registered on the server with a name and ID.
- However, the agent process is unable to modify its own
buildAgent.propertiesfile. The following warning can be found in the build agent logs:File "/home/teamcity/buildAgent/bin/../conf/buildAgent.properties" can not be modified. Current properties were changed in memory, but after restart of the agent old properties will be used. - If the agent needs to be restarted (for example, when it receives an upgrade command from the server), it won't be able to reuse the same authentication token.
- After the restart, the agent tries to register on the server again, but since the authentication token wasn't persisted, it receives a new one and is registered with a new ID.
Resolution
The issue is caused by access permissions.
Make sure that the build agent process can modify its buildAgent.properties file to ensure that the authentication token persists across reboots.
Comments
0 comments
Please sign in to leave a comment.