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

.hpi versus .jpi causes inability to upgrade Subversion Plugin

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Ubuntu 11.10, OpenJDK 1.6.0_23, Tomcat 7.0.21, Jenkins 1.448 & 1.449
      Jenkins 1.456 on Windows Server 2003 64-bit, Sun JDK 6.0.260.3
    • Similar Issues:

      Description

      Reproduction:
      $JENKINS_HOME/plugins: subversion (directory), subversion.hpi
      1) Open http://<root>/pluginManager. Update Subversion plugin from 1.34 -> 1.37 using download now and install after restart button.
      $JENKINS_HOME/plugins: subversion (directory), subversion.bak (1.34), subversion.hpi.pinned, subversion.jpi (1.37)
      2) Restart Tomcat/Jenkins
      $JENKINS_HOME/plugins: subversion (directory), subversion.bak (1.34), subversion.hpi (1.34) subversion.hpi.pinned, subversion.jpi (1.37)
      3) PluginManager still reports old version

      Should note that the logs report:
      INFO: Ignoring /ci/jenkins-home/plugins/subversion.jpi because /ci/jenkins-home/plugins/subversion.hpi is already loaded

      Also the plugin is broken at this point with a NoClassDefFound on org/tmatesoft/svn/core/SVNException

      Clean State:
      1) /etc/init.d/tomcat7 stop
      2) cd $JENKINS_HOME/plugins
      3) rm subversion*
      4) /etc/init.d/tomcat7 start

      Workaround:
      1) Restore clean state
      2) Update plugin
      3) Stop tomcat/jenkins
      4) cd $JENKINS_HOME/plugins
      5) mv subversion.jpi subversion.hpi
      6) Start tomcat/jenkins

        Attachments

          Issue Links

            Activity

            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            This is fixed in ba71264b6b6d75e0c86699d02700dea56f388105 toward 1.450.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - This is fixed in ba71264b6b6d75e0c86699d02700dea56f388105 toward 1.450.
            Hide
            karianna karianna added a comment -

            Problem still exists in 1.450

            Show
            karianna karianna added a comment - Problem still exists in 1.450
            Hide
            karianna karianna added a comment -

            Problem still exists in 1.450, default plugin is now .jpi extension, but upgrade problem remains, even with fresh install.

            Show
            karianna karianna added a comment - Problem still exists in 1.450, default plugin is now .jpi extension, but upgrade problem remains, even with fresh install.
            Hide
            alexlehm Alex Lehmann added a comment -

            I had to set up a "fresh" jenkins instance for dev testing, so I had a new chance to check if updating the plugins works or not, it turns out it doesn't.

            The file is updated in the plugin directory, but the .pinned file is not created so that old plugin is reinstalled when restarting the server.

            When I create the .pinned files manually after shutting down the server, the update works, that provides a work-around at least.

            Show
            alexlehm Alex Lehmann added a comment - I had to set up a "fresh" jenkins instance for dev testing, so I had a new chance to check if updating the plugins works or not, it turns out it doesn't. The file is updated in the plugin directory, but the .pinned file is not created so that old plugin is reinstalled when restarting the server. When I create the .pinned files manually after shutting down the server, the update works, that provides a work-around at least.
            Hide
            itl_software_developer Mark Andrews added a comment -

            Problem still exists in 1.451

            Show
            itl_software_developer Mark Andrews added a comment - Problem still exists in 1.451
            Hide
            tuomassiren Tuomas Siren added a comment -

            And in 1.454. I hate to use the pinning workaround for subversion upgrade, so I'd say this is more than just a minor issue.

            Show
            tuomassiren Tuomas Siren added a comment - And in 1.454. I hate to use the pinning workaround for subversion upgrade, so I'd say this is more than just a minor issue.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            I just tried it and it works for me. The change in ba71264b6b6d75e0c86699d02700dea56f388105 does the forced normalization of "s/hpi/jpi/".

            My current hypothesis is that this is only a problem on Windows, as I use "java.io.File.renameTo()" to move a file, and I expect the Unix semantis of overwrite when the destination already exists.

            Verifying this on Windows now.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - I just tried it and it works for me. The change in ba71264b6b6d75e0c86699d02700dea56f388105 does the forced normalization of "s/hpi/jpi/". My current hypothesis is that this is only a problem on Windows, as I use "java.io.File.renameTo()" to move a file, and I expect the Unix semantis of overwrite when the destination already exists. Verifying this on Windows now.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            Yep.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - Yep.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            changelog.html
            core/src/main/java/hudson/PluginManager.java
            http://jenkins-ci.org/commit/jenkins/132f8b769d3cd39861d686ccf0751fd81cf8595d
            Log:
            [FIXED JENKINS-12514]

            Fixed the file overwrite problem on Windows.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/PluginManager.java http://jenkins-ci.org/commit/jenkins/132f8b769d3cd39861d686ccf0751fd81cf8595d Log: [FIXED JENKINS-12514] Fixed the file overwrite problem on Windows.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            Bumping up the priority to merge this to LTS since this affects upgrading users.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - Bumping up the priority to merge this to LTS since this affects upgrading users.
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #1579
            [FIXED JENKINS-12514] (Revision 132f8b769d3cd39861d686ccf0751fd81cf8595d)

            Result = UNSTABLE
            Kohsuke Kawaguchi : 132f8b769d3cd39861d686ccf0751fd81cf8595d
            Files :

            • core/src/main/java/hudson/PluginManager.java
            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #1579 [FIXED JENKINS-12514] (Revision 132f8b769d3cd39861d686ccf0751fd81cf8595d) Result = UNSTABLE Kohsuke Kawaguchi : 132f8b769d3cd39861d686ccf0751fd81cf8595d Files : core/src/main/java/hudson/PluginManager.java changelog.html
            Hide
            greg_allen Greg Allen added a comment -

            not fixed on Windows in 1.456.

            Tried upgrading Subversion plugin from default 1.34 to latest 1.39 using plugin update page.

            new version gets downloaded and can be seen in the plugins directory. old ".bak" version of plugin is there too. However, on restart the newly downloaded subversion.jpi file seems to get overwritten, and the installed version is still 1.34.

            Show
            greg_allen Greg Allen added a comment - not fixed on Windows in 1.456. Tried upgrading Subversion plugin from default 1.34 to latest 1.39 using plugin update page. new version gets downloaded and can be seen in the plugins directory. old ".bak" version of plugin is there too. However, on restart the newly downloaded subversion.jpi file seems to get overwritten, and the installed version is still 1.34.
            Hide
            billm Bill Michell added a comment -

            The issue also affects Mac OS X 1.457

            Show
            billm Bill Michell added a comment - The issue also affects Mac OS X 1.457
            Hide
            alexlehm Alex Lehmann added a comment -

            fixed with JENKINS-13129

            Show
            alexlehm Alex Lehmann added a comment - fixed with JENKINS-13129
            Hide
            rborer Reynald Borer added a comment -

            Still happening with Jenkins 1.458 running under debian squeeze (with the debian package).

            Show
            rborer Reynald Borer added a comment - Still happening with Jenkins 1.458 running under debian squeeze (with the debian package).
            Hide
            bhazard Bill Hazard added a comment -

            for those seeking a workaround:

            rm WEB-INF/plugins/subversion.hpi and re-install via Manage Plugins

            ditto for cvs and translation

            Show
            bhazard Bill Hazard added a comment - for those seeking a workaround: rm WEB-INF/plugins/subversion.hpi and re-install via Manage Plugins ditto for cvs and translation
            Hide
            lyle_lee Lyle Lee added a comment -

            Must be consider about upgrade subversion plugin by hand without internet connection.

            Following the instruction on wiki page, restarting the server with jenkins.war after putting subversion.hpi in $JENKINS_HOME/plugins overwrites just copied new version with old one included in jenkins.war.

            I found that this problem can be solved by removing $JENKINS_HOME/war/WEB-INF/plugins/subversion.hpi before restarting the server. But it's not general way and also conflicts over wiki instruction.

            Show
            lyle_lee Lyle Lee added a comment - Must be consider about upgrade subversion plugin by hand without internet connection. Following the instruction on wiki page, restarting the server with jenkins.war after putting subversion.hpi in $JENKINS_HOME/plugins overwrites just copied new version with old one included in jenkins.war. I found that this problem can be solved by removing $JENKINS_HOME/war/WEB-INF/plugins/subversion.hpi before restarting the server. But it's not general way and also conflicts over wiki instruction.
            Hide
            nikhilvasaikar Nikhil Vasaikar added a comment - - edited

            I am facing a similar issue, when uploading a new hpi file. The plugin gets uploaded form the Advanced Tab. I can see the .jpi file and the exploded folder under JENKINS_HOME\plugins. I restarted Jenkins.

            When I go on the Configure screen, I can't see my plugin options, as if the plugin was never installed.

            Jenkins version : 1.488

            Show
            nikhilvasaikar Nikhil Vasaikar added a comment - - edited I am facing a similar issue, when uploading a new hpi file. The plugin gets uploaded form the Advanced Tab. I can see the .jpi file and the exploded folder under JENKINS_HOME\plugins. I restarted Jenkins. When I go on the Configure screen, I can't see my plugin options, as if the plugin was never installed. Jenkins version : 1.488
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Does anyone see the issue on newest Jenkins versions (1.532+)?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Does anyone see the issue on newest Jenkins versions (1.532+)?
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            No further input. Closing.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - No further input. Closing.
            Hide
            mr_dfuse Nico Mommaerts added a comment -

            Yes, I still see this happening on the latest lts (1.565.2)
            Also for the credentials plugin

            Show
            mr_dfuse Nico Mommaerts added a comment - Yes, I still see this happening on the latest lts (1.565.2) Also for the credentials plugin
            Hide
            martinb3 Martin Smith added a comment - - edited

            Hello! I'm still seeing this on the latest Jenkins LTS 1.609.3 (2015/09/02) as well. I've documented a lot of it in an issue filed against the Chef cookbook for Jenkins at https://github.com/chef-cookbooks/jenkins/issues/406, but the core of the issue is this:

            # sha256sum /var/chef/cache/cvs-2.12.plugin 
            6e6dfd35e8501bf5f84a9d43d210db61165ce51a606327fc81f2efc5208478ba  /var/chef/cache/cvs-2.12.plugin
            
            # unzip /var/chef/cache/cvs-2.12.plugin
            # grep -i plugin-version META-INF/MANIFEST.MF 
            Plugin-Version: 2.12
            
            # sha256sum /var/lib/jenkins/plugins/cvs.jpi 
            6e6dfd35e8501bf5f84a9d43d210db61165ce51a606327fc81f2efc5208478ba  cvs.jpi
            
            # grep -i plugin-version /var/lib/jenkins/plugins/cvs/META-INF/MANIFEST.MF 
            Plugin-Version: 2.11
            
            # mv /var/lib/jenkins/war/WEB-INF/plugins/cvs.hpi /tmp/nonchef-cvs.hpi
            
            # service jenkins restart
            ok: run: jenkins: (pid 14918) 1s
            
            # grep -i plugin-version /var/lib/jenkins/plugins/cvs/META-INF/MANIFEST.MF 
            Plugin-Version: 2.12
            

            As you can see, Jenkins won't upgrade the plugin, even though it's a newer version, until I manually remove the .hpi and restart Jenkins.

            Show
            martinb3 Martin Smith added a comment - - edited Hello! I'm still seeing this on the latest Jenkins LTS 1.609.3 (2015/09/02) as well. I've documented a lot of it in an issue filed against the Chef cookbook for Jenkins at https://github.com/chef-cookbooks/jenkins/issues/406 , but the core of the issue is this: # sha256sum / var /chef/cache/cvs-2.12.plugin 6e6dfd35e8501bf5f84a9d43d210db61165ce51a606327fc81f2efc5208478ba / var /chef/cache/cvs-2.12.plugin # unzip / var /chef/cache/cvs-2.12.plugin # grep -i plugin-version META-INF/MANIFEST.MF Plugin-Version: 2.12 # sha256sum / var /lib/jenkins/plugins/cvs.jpi 6e6dfd35e8501bf5f84a9d43d210db61165ce51a606327fc81f2efc5208478ba cvs.jpi # grep -i plugin-version / var /lib/jenkins/plugins/cvs/META-INF/MANIFEST.MF Plugin-Version: 2.11 # mv / var /lib/jenkins/war/WEB-INF/plugins/cvs.hpi /tmp/nonchef-cvs.hpi # service jenkins restart ok: run: jenkins: (pid 14918) 1s # grep -i plugin-version / var /lib/jenkins/plugins/cvs/META-INF/MANIFEST.MF Plugin-Version: 2.12 As you can see, Jenkins won't upgrade the plugin, even though it's a newer version, until I manually remove the .hpi and restart Jenkins.
            Hide
            danielbeck Daniel Beck added a comment -

            Whatever that is, it's probably a different problem than the one reported almost four years ago.

            Show
            danielbeck Daniel Beck added a comment - Whatever that is, it's probably a different problem than the one reported almost four years ago.

              People

              • Assignee:
                kohsuke Kohsuke Kawaguchi
                Reporter:
                acharlieh Charlie Huggard
              • Votes:
                18 Vote for this issue
                Watchers:
                28 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: