Jenkins 2.53
SonarQube Scanner 2.7.1
Windows Server 2012
During installation (first time) of SonarQube Scanner plugin Jenkins shows the error below.
Apparently Jenkins is trying to remove the plugin folder and fails since another process is using a file there. But the only process that is using the file is Jenkins (Java engine) itself!
I was able to manually remove the folder after stopping Jenkins service manually, but the problem reappeared on a next installation attempt.
java.nio.file.FileSystemException: D:\dev\Jenkins\plugins\sonar\WEB-INF\lib\commons-io-2.4.jar: 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 'D:\dev\Jenkins\plugins\sonar'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
at hudson.Util.deleteRecursive(Util.java:346)
at hudson.ClassicPluginStrategy.explode(ClassicPluginStrategy.java:600)
at hudson.ClassicPluginStrategy.createPluginWrapper(ClassicPluginStrategy.java:163)
at hudson.PluginManager.dynamicLoad(PluginManager.java:848)
at hudson.PluginManager.dynamicLoad(PluginManager.java:813)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1892)
Caused: java.io.IOException: Failed to dynamically deploy this plugin
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1896)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1653)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Unknown Source)