Linux: Build Agent exits with code 137 and restarts periodically
Completed
We have a lot of linux agents which are working fine, but one of them is constantly exiting every couple of days with exit code 137. We've tried to change the build steps, and it seemed it was working as we didn't noticed the issue for almost 10 days. After the sudden restart, some files from the agent are owned by root user and cannot be deleted by the checkout directory cleanup build step, thus rendering the agent useless. Here you can see the the launcher log excerpt:
[2020-04-23 01:22:36,122] INFO - dServer.agent.run.AgentProcess - Agent process finished [2020-04-23 01:22:36,473] INFO - ldServer.agent.run.AgentRunner - Agent has exited with code: 137 [2020-04-23 01:22:36,619] ERROR - ldServer.agent.run.AgentRunner - Too long run time, unexpected exit. Restarting. Run time was : 829958.641 sec. [2020-04-23 01:22:36,697] INFO - ldServer.agent.run.AgentRunner - Launcher is restarting agent process. [2020-04-23 01:22:36,951] INFO - dServer.agent.run.AgentProcess - Thu Apr 23 01:22:36 CEST 2020 ==> Start launch [2020-04-23 01:22:37,232] DEBUG - .buildServer.agent.JavaChooser - Agent Java runtime version is 1.8
We didn't found any information about this particular exit code around here (all of the results are pointing to an error regarding process exit with code 137). We would appreciate any help.
Thanks,
Sorin
Please sign in to leave a comment.
Hello Sorin!
Could you please confirm the OS and Java version on the agent machine? What is the TeamCity version you are using? Are there any other agents sharing the machine with the agent in question?
I would also like to ask you to share the teamcity-agent.log. (you may do so in a private manner via "Submit a request" form)