One of developer is applying patch to CI and has broken the CI build. The error occurred as below in the build log. I have done the below steps and still doesnot work.
Questions:
Build log:
[18:32:28]Checking for changes
[18:35:15]Publishing internal artifacts
[18:35:15]Clearing temporary directory: D:\TeamCity\buildAgent\temp\buildTmp
[18:35:15]Checkout directory: D:\TeamCity\buildAgent\work\35b0f615bcea75bd
[18:35:15]Updating sources: server side checkout (2m:09s)
[18:35:16][Updating sources] Will perform clean checkout. Reason: Agent doesn't have any version of the project sources
[18:35:16][Updating sources] Building clean patch for VCS root: ProjectName Trunk
[18:37:24][Updating sources] Transferring cached clean patch for VCS root: ProjectName Trunk
[18:37:25][Updating sources] Repository sources transferred: 27.61Mb total
[18:37:25][Updating sources] Removing D:\TeamCity\buildAgent\work\35b0f615bcea75bd
[18:37:25][Updating sources] Error while applying patch: Failed to delete: D:\TeamCity\buildAgent\work\35b0f615bcea75bd\ProjectName\bin\Debug
[18:37:25]Publishing internal artifacts
[18:37:25]Build failed to start. Artifacts will not be published for this build
[18:37:26]Build finished
We have had this issue when running Selenium tests and the browser was not properly shut down. We actually created a powershell script that we execute as a build on any of our agents that will kill any outstanding IE or Firefox or Chrome processes. We also ensured that our tests always close the browser on teardown.
If you have enough privileges, you can remotely restart the build agent from the TeamCity web interface. You this by clicking on the Agents tab at the top, selecting the offending agent, and then select "Reboot Agent Machine". You can read more in the TeamCity documentation.
Question 1. Yes, deleting the folder is your best bet to resolve the current situation.
Question 2. Whenever I've had an issue like this it's been because there is a file in use in the folder that cannot be deleted. So I would suggest that you use a tool like Process Monitor on the TeamCity server to work out what file is in use.
Question 3. Once you have worked out what was in use you'll need to work out why to stop it again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With