Jenkins – Files won’t get deleted from workspace while cleaning up

continuous integrationhudsonJenkinsjenkins-plugins

I have the following error and the jenkins is unable to remove some files from the workspace. I can manually remove the file but how can I make it automated? I checked delete workspace before building and inserted **/tellar.tar.gz in "patterns of the file to delete and include" but still wouldn't do it.

Deleting project workspace…

Cleaning local Directory .

hudson.util.IOException2: remote file operation failed: /local/hudson/workspace/CITI_PATCH_LATE at hudson.remoting.Channel@bac49a:usnjapp09.mh.lucent.com
at hudson.FilePath.act(FilePath.java:848)
at hudson.FilePath.act(FilePath.java:825)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:743)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:685)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1325)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:682)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:587)
at hudson.model.Run.execute(Run.java:1543)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
Caused by: java.io.IOException: Unable to delete /local/hudson/workspace/CITI_PATCH_LATE/./CITI/citi_patch_ll151_rctm/check/tellar.tar.gz
at hudson.Util.deleteFile(Util.java:243)
at hudson.Util.deleteRecursive(Util.java:293)
at hudson.Util.deleteContentsRecursive(Util.java:204)
at hudson.Util.deleteRecursive(Util.java:284)
at hudson.Util.deleteContentsRecursive(Util.java:204)
at hudson.Util.deleteRecursive(Util.java:284)
at hudson.Util.deleteContentsRecursive(Util.java:204)
at hudson.Util.deleteRecursive(Util.java:284)
at hudson.Util.deleteContentsRecursive(Util.java:204)
at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:71)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:136)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:788)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:769)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:753)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2309)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Archiving artifacts

Best Answer

I was facing the same issue, then I realized that my explorer was accessing the directory that Jenkins was trying to delete. After closing the explorer, the job succeeded.

So even you can try closing all application accessing the folder in your workspace.

Related Topic