Disable Teamcity agent auto deleting workspaces when machine out of space
Answered
Hey there,
So i have noticed that when the drive that hold the workspaces for an agent is running very low on space, it tend to go and delete some of the workspaces automatically.
This is really bad for our workflow as we are using Unity and a workspace wipe can cost use 2-3 days of lost work while the workspace is recreated.
Is there a way to disable this behavior? I would rather the agent fail with an out of space error, or the p4 sync call fail for the same reason.
Cheers,
Chris
Please sign in to leave a comment.
Hello Chris,
As per this article, you could disable clean-up of workspaces (TeamCity will remove workspaces related to the checkout directories which were not used for 8 days by default) by using this build parameter (either defined in buildAgent.properties or as a Root project parameter):
teamcity.perforce.workspace.cleanup=false
Please let me know if this approach works for you.
Unfortunately this does not help, sorry i should have said that this was already set. I have these settings inside the buildagent.properties:
teamcity.agent.filecache.publishing.disabled=true
teamcity.agent.failBuildOnCleanCheckout=true
teamcity.perforce.workspace.cleanup=false
system.teamcity.agent.build.checkoutDir.expireHours=never
teamcity.artifacts.useZip64=true
But checkout dir are still been cleaned up when space is low
Cheers,
Chris
Hello Chris,
Could I ask you to share the <build agent install folder>/logs/teamcity-agent.log and teamcity-vcs.log files for any agent where the workspaces were removed recently? You could use https://uploads.jetbrains.com to do so in a private manner. In addition, if you could enable generic debug for any agent (to try and catch extra logging on the moment when workspace is gone), it would be helpful.
is teamcity.perforce.workspace.cleanup only for perforce?
Hello!
Yes, this property is Perforce-specific. Could you please let me know what VCS you are using and what behavior you would like to ensure?
we use git ,and have the same problem with Chris,
here are some log
Hello!
If you need to ensure specific checkout directory is never removed during the build, you could use the following build configuration property (as described in this article):
If you have this property set for a build configuration (or a project), this will ensure that the checkout directories they use will always persist. The property can also be set to a numeric value to define how old the directory has to be in order to be removed on expiration/cleanup routine.