Hello,
I am constantly getting this error in Jenkins when I try to delete a job or
folder either manually through UI or by calling API.
The processexplorer was used for realizing what process locks a log file - that is the Jenkins's service.
Service is running under a special user account (not the default one). This account don't have any issues with the filesystem permissions.
Yes, the folder where is Jenkins is installed is "tools)"
---
A problem occurred while processing the request. Please check our bug
tracker to see if a similar problem has already been reported. If it is
already reported, please vote and put a comment on it to let us gauge the
impact of the problem. If you think this is a new issue, please file a new
issue. When you file an issue, make sure to add the entire stack trace,
along with the version of Jenkins and relevant plugins. The users list
might be also useful in understanding what has happened.
Stack trace
java.nio.file.FileSystemException:
c:\tools)\Jenkins\jobs\Core\jobs\Plans\jobs\PDFTests\jobs\PDFTests.Test1\builds\3\log:
The process cannot access the file because it is being used by another
process.
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source)
at java.nio.file.Files.deleteIfExists(Unknown Source)
at hudson.Util.tryOnceDeleteFile(Util.java:287)
at hudson.Util.tryOnceDeleteRecursive(Util.java:364)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:383)
at hudson.Util.tryOnceDeleteRecursive(Util.java:363)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:383)
at hudson.Util.tryOnceDeleteRecursive(Util.java:363)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:383)
at hudson.Util.tryOnceDeleteRecursive(Util.java:363)
at hudson.Util.deleteRecursive(Util.java:341)
Caused: java.io.IOException: Unable to delete
'c:\tools)\Jenkins\jobs\Core\jobs\Plans\jobs\PDFTests\jobs\PDFTests.Test1'.
Tried 3 times (of a maximum of 3) waiting 0.1 =D1=81=D0=B5=D0=BA=D1=83=D0=
=BD=D0=B4 between attempts.
at hudson.Util.deleteRecursive(Util.java:346)
at hudson.model.AbstractItem.performDelete(AbstractItem.java:584)
at hudson.model.Job.performDelete(Job.java:276)
at hudson.model.AbstractProject.performDelete(AbstractProject.java:379)
at hudson.model.AbstractItem.delete(AbstractItem.java:573)
at hudson.model.Job.delete(Job.java:683)
at
com.cloudbees.hudson.plugins.folder.AbstractFolder.delete(AbstractFolder.ja=
va:1330)
Caused: java.io.IOException: Failed to delete Core =C2=BB Plans =C2=BB PDFT=
ests =C2=BB
PDFTests.Test1
at
com.cloudbees.hudson.plugins.folder.AbstractFolder.delete(AbstractFolder.ja=
va:1335)
at hudson.model.AbstractItem.doDoDelete(AbstractItem.java:534)
at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343=
)
at
org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.ja=
va:52)
at
org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeIntercepte=
dFunction.java:26)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
at
org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:11=
7)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)
at
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:5=
8)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
at
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:5=
8)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
at
org.kohsuke.stapler.NameBased
----- Message truncated -----