bamboo v5.4.1: Unable to clean source directory ...unable to delete file *\.svn\wc.db
Asked by Hussain Misbah:

Hello everyone,

I am having this problem with several projects plans , the build fail because the system fail to clean the project ==\> it fail to delete subversion related file wc.db .

is there any solution or work around for this ?

now I go manually and delete the .svn folder.

Thanks


Answers:
author: Richard Cross
body: I get this problem if the source directory contains file/directory names consisting of non-UTF-8 characters.


author: Adam
body: My client has the same issue...I checked to see which process was holding the lock on the file in question and it's the bamboo remote agent service.

So this is a bamboo bug...what is the process my client should go through to progress a fix for this?

comments: author: Przemek Bruski
body: First upgrade to a more recent version of Bamboo, it contains a newer version of svnkit library, which will likely fix your issue. If it does not, open a support request at support.atlassian.com


author: Przemek Bruski
body: Chances are it's your antivirus that locks that file. Can you try excluding that directory from antivirus?

comments: author: Ryan Goodwin
body: Worthy suggestion. Putting an exception in place.


author: Ryan Goodwin
body: Some success implementing scripts that clean the location before the build begins...

Not optimal.


author: Ryan Goodwin
body: We're also experiencing this issue. Though we have \~10 agents that could run this job so it only seems to fail when it is run on an agent that has already run the job. Any ideas?

And yes, the agents have permission to the directory.

comments: author: Daniel Wester
body: It sounds like something is holding a handle open.http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx is supposed to be able to help you identify stuck handles (I'm not a windows person though so...)


author: Ryan Goodwin
body: Neither am I!


author: rsperafico
body: Hi guys,

I would kindly ask you to:

1. run the task once again (this will generate new entries to the logs files)
2. open up \<bamboo-home\>/logs/atlassian-bamboo.log
3. post the stacktrace where the issue happens

Alternatively, I would suggest you on:

* running the task once agian (this will generate new entries to the logs files)
* creating a support request under Bamboo administration \>\> System \>\> Atlassian Support Tools \>\> Support Request  
  Please check all options under Support Data to Attach before submitting your Support Request.

Kind regards,  
Rafael

comments: author: Hussain Misbah
body: Hi Everyone , thanks for the replies.. I am running Bamboo on Windows and it is runing as a windows service using the local system account.. the fact that this happen with only subversion special files that get created automatically when Bamboo checkout the code ..make me wonder if there is a special config to do that will make Bamboo work better with subversion.

I will create a support request the next time this happen, now I deleted that folder manually .

Thanks Rafael and everyone else here.


author: Spot Support
body: I had run into this issue which occurs when trying to delete a particular subdirectory in deployment projects. Like Rafael mentioned, I had to add a script that does exactly that.

However, since we have nearly 200 deployment plans, this will be quite tedious and to be honest, extremely frustrating to even have to do this.

C'mon Atlassian, is this currently a tracked bug?


author: rsperafico
body: Hi Hussain,

Would be possible to inform in which Operational System Bamboo is running on, please? Due to what you have informed on your comment , it seems you are running Bamboo on a Linux / Mac OS environment.

If you go to the Plan Configuration \>\> Stages, select your stage created and click on Tasks tab there is an option in the task "Source Code Checkout configuration" that removes the source directory and checks it out again prior to each build. This may significantly increase build times (\[ \] Force Clean Build).

Another option would be under Plan Configuration \>\> Stages, select your stage created and click on Miscellaneous tab. You will find an option that removes the source directory after each build. This may increase build times but save disk space. (\[ \] Clean working directory after each build).

Alternatively, you can create an Script tasks to delete the folder/file you want.

```
// the following command will delete a directory recursivelyrm -rf /&lt;path&gt;/&lt;to&gt;/&lt;directory&gt;
```

Kind regards,  
Rafael


author: Timothy
body: Does the user running Bamboo have permission to that file?