We have Jenkins instances running in a Kubernetes cluster. These instances have the Kubernetes plugin installed.
When upgrading the instance LTS version (by updating the tag in the Jenkins helm chart), we see an issue where the config.xml file wipes out the <clouds>
configuration. In the logs, I see an exception related to the Plugin Manager trying to inspect the Kubernetes plugin:
2023-06-12 23:58:44.011+0000 [id=45] SEVERE jenkins.InitReactorRunner$1#onTaskFailed: Failed Inspecting plugin /var/jenkins/plugins/kubernetes.jpi Also: Also: java.nio.file.FileSystemException: /var/jenkins/plugins/kubernetes/WEB-INF/lib/.nfs00000000bad93ee400001f77: Device or resource busy at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:249) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:234) Also: java.nio.file.FileSystemException: /var/jenkins/plugins/kubernetes/WEB-INF/lib/.nfs00000000bad93ee400001f77: Device or resource busy at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:249) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238) jenkins.util.io.CompositeIOException: Unable to remove file /var/jenkins/plugins/kubernetes/WEB-INF/lib/.nfs00000000bad93ee400001f77 at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:249) at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213) at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:223) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212) at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:223) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212) at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:223) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212) at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93) Also: Also: java.nio.file.DirectoryNotEmptyException: /var/jenkins/plugins/kubernetes/WEB-INF/lib at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:247) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:234) Also: java.nio.file.DirectoryNotEmptyException: /var/jenkins/plugins/kubernetes/WEB-INF/lib at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:247) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238) jenkins.util.io.CompositeIOException: Unable to remove directory /var/jenkins/plugins/kubernetes/WEB-INF/lib with directory contents: [/var/jenkins/plugins/kubernetes/WEB-INF/lib/.nfs00000000bad93ee400001f77] at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:247) at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213) at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:223) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212) at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:223) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212) at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93) Also: Also: java.nio.file.DirectoryNotEmptyException: /var/jenkins/plugins/kubernetes/WEB-INF at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:247) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:234) Also: java.nio.file.DirectoryNotEmptyException: /var/jenkins/plugins/kubernetes/WEB-INF at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:247) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238) jenkins.util.io.CompositeIOException: Unable to remove directory /var/jenkins/plugins/kubernetes/WEB-INF with directory contents: [/var/jenkins/plugins/kubernetes/WEB-INF/lib] at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:247) at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213) at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:223) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212) at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93) Also: Also: java.nio.file.DirectoryNotEmptyException: /var/jenkins/plugins/kubernetes at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:247) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:234) Also: java.nio.file.DirectoryNotEmptyException: /var/jenkins/plugins/kubernetes at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:247) at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110) at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181) at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238) jenkins.util.io.CompositeIOException: Unable to remove directory /var/jenkins/plugins/kubernetes with directory contents: [/var/jenkins/plugins/kubernetes/WEB-INF] at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:247) at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202) at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213) at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93) jenkins.util.io.CompositeIOException: Unable to delete '/var/jenkins/plugins/kubernetes'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:96) at hudson.Util.deleteRecursive(Util.java:320) at hudson.Util.deleteRecursive(Util.java:309) at hudson.ClassicPluginStrategy.explode(ClassicPluginStrategy.java:493) at hudson.ClassicPluginStrategy.createPluginWrapper(ClassicPluginStrategy.java:170) at hudson.PluginManager$1$3$1.run(PluginManager.java:447) at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:177) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1164) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
Is it possible that the PluginManager failing to inspect the Kubernetes plugin files is wiping out the <clouds>
portion of the config.xml?