Build failed when new build cleaning up

The builds randomly fail on start up.  I cut and past this title from another post; it seems to be a common problem.  Mine was different then the poster's whose title I co-opted in that I'm not using unit tests (just yet).  I'm running nant, and perforce.

Failed to start build:  Failed to clean files from: C:\TeamCity\buildAgent\work\fc9b0c0fedc3d0e
jetbrains.buildServer.RunBuildException:  Failed to clean files from: C:\TeamCity\buildAgent\work\fc9b0c0fedc3d0e
at  jetbrains.buildServer.agent.impl.buildStages.startStages.CleanBuildCheckoutDirectoryIfNeededStage$1.logFailedToCleanEntireFolder(  
at  jetbrains.buildServer.agent.impl.buildStages.startStages.DirectoryCleanerStage$1.logFailedToCleanEntireFolder(  
at  jetbrains.buildServer.agent.impl.directories.SmartDirectoryCleanerImpl.cleanFolder(  
at  jetbrains.buildServer.agent.impl.buildStages.startStages.DirectoryCleanerStage.doBuildStage(  
at  jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(  
at  jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(  
at  jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(  
at  jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(  
at  jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(  
at  jetbrains.buildServer.agent.impl.BuildRunAction.doStages(  
at  jetbrains.buildServer.agent.impl.BuildRunAction.runBuild(  
at  jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(  
at  jetbrains.buildServer.agent.impl.BuildAgentImpl.access$100(  
at  jetbrains.buildServer.agent.impl.BuildAgentImpl$  
at Source)

So far I have to restart the build agent each time I encounter this error. Is there a solution in the pipe for this?  I'm running 6.5.4 (build 18046) in a test enviroment and it doesn't seem our production enviroment (6.5.2) has this problem.  This is not a "sometimes" thing... it happens every day, several times a day.  I keep the services window open I'm restarting that agent that often.
1 comment
Comment actions Permalink

Hi David

Check if are there any processes left after a build which lock file handles in the checkout directory.
Also, we have Build Files Cleaner feature that allows to close the handles automatically.



Please sign in to leave a comment.