Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37332

java.io.IOException: Failed to rename during Plugin Update

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Windows
      Jenkins 2.17

      We are currently unable to update plugins in our jenkins installation, because this exception occurs:

      java.io.IOException: Failed to rename C:\Program Files (x86)\Jenkins\plugins\windows-slaves.jpi.tmp to C:\Program Files (x86)\Jenkins\plugins\windows-slaves.jpi
      at hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:1952)
      at hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1178)
      at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1653)
      at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1848)
      at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1624)
      at java.util.concurrent.Executors$RunnableAdapter.call(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)

      It doesn't seem to affect all plugins, but it also happends for the JUnit plugin.

          [JENKINS-37332] java.io.IOException: Failed to rename during Plugin Update

          Oleg Nenashev added a comment -

          The fix should have been integraed into 2.7.3 Checking

          Oleg Nenashev added a comment - The fix should have been integraed into 2.7.3 Checking

          Oleg Nenashev added a comment -

          Well, it was not
          CC danielbeck olivergondza

          Oleg Nenashev added a comment - Well, it was not CC danielbeck olivergondza

          Oleg Nenashev added a comment -

          brianeray
          Are you sure it is caused by this problem? https://github.com/jenkinsci/jenkins/commit/2a450e5ac2ecd83a54f05c83729852073601816e has not been backported to 2.7.3, hence there should not be such problem.

          Could you please run your instance with http://file-leak-detector.kohsuke.org/ and report the list of open file handles?

          Oleg Nenashev added a comment - brianeray Are you sure it is caused by this problem? https://github.com/jenkinsci/jenkins/commit/2a450e5ac2ecd83a54f05c83729852073601816e has not been backported to 2.7.3, hence there should not be such problem. Could you please run your instance with http://file-leak-detector.kohsuke.org/ and report the list of open file handles?

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - Oops. Logs say it has been actually backported: https://github.com/jenkinsci/jenkins/commit/6ea7883fed497b68eec9f89ec89082edf1b39ce5

          Brian Ray added a comment -

          Thank you oleg_nenashev for the quick response and making this an LTS candidate. My process explorer revealed the same leaked file descriptors on the bundled plugin JPIs.

          My workaround was to downgrade to 2.7.2, upgrade these plugins, then upgrade once again to 2.7.3.

          Brian Ray added a comment - Thank you oleg_nenashev for the quick response and making this an LTS candidate. My process explorer revealed the same leaked file descriptors on the bundled plugin JPIs. My workaround was to downgrade to 2.7.2, upgrade these plugins, then upgrade once again to 2.7.3.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/PluginManager.java
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/PluginManagerTest.java
          http://jenkins-ci.org/commit/jenkins/37edc1a3b0c5670c24bd06d157f4de91b99f8391
          Log:
          [FIXED JENKINS-37332] - Prevent File descriptor leaks when reading manifests from JARs (#2516)

          • JENKINS-37332 - Improve diagnostics of non-closed streams during reading of the manifests in PluginManager
          • JENKINS-37332 - Leakless processing of JarUrlConnection during Manifest parsing
          • JENKINS-37332 - Also implement leak-safe method for retrieving file modification date
          • JENKINS-37332 - Add spotcheck methods for manifest file access + Javadoc
          • JENKINS-37332 - Also test multi-line and empty attributes in the test

          (cherry picked from commit 96c97860b0f018094c20283b15f3ddb3bdd9effe)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/PluginManager.java core/src/main/java/hudson/Util.java core/src/test/java/hudson/PluginManagerTest.java http://jenkins-ci.org/commit/jenkins/37edc1a3b0c5670c24bd06d157f4de91b99f8391 Log: [FIXED JENKINS-37332] - Prevent File descriptor leaks when reading manifests from JARs (#2516) JENKINS-37332 - Improve diagnostics of non-closed streams during reading of the manifests in PluginManager JENKINS-37332 - Leakless processing of JarUrlConnection during Manifest parsing JENKINS-37332 - Also implement leak-safe method for retrieving file modification date JENKINS-37332 - Add spotcheck methods for manifest file access + Javadoc JENKINS-37332 - Also test multi-line and empty attributes in the test (cherry picked from commit 96c97860b0f018094c20283b15f3ddb3bdd9effe)

          Oleg Nenashev added a comment -

          danielbeck It has been reopened intentionally since the bug is in LTS now

          Oleg Nenashev added a comment - danielbeck It has been reopened intentionally since the bug is in LTS now

          olivergondza I also have this issue on our Jenkins instance (IIRC with the Mailer plugin).

          Ing. Christoph Obexer added a comment - olivergondza I also have this issue on our Jenkins instance (IIRC with the Mailer plugin).

          Oleg Nenashev added a comment -

          2.7.4 release discussion: https://groups.google.com/forum/#!topic/jenkinsci-dev/zIq6EgUPQBI
          Please vote there if you're affected

          Oleg Nenashev added a comment - 2.7.4 release discussion: https://groups.google.com/forum/#!topic/jenkinsci-dev/zIq6EgUPQBI Please vote there if you're affected

          Fixed on 2.7 LTS line in 2.7.4.

          Oliver Gondža added a comment - Fixed on 2.7 LTS line in 2.7.4.

            oleg_nenashev Oleg Nenashev
            nitek Claus Näveke
            Votes:
            13 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: