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

InstallPluginCommand: Cannot upgrade bundled plugins

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: cli, core
    • Labels:
      None
    • Environment:
      # java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ version
      1.622
    • Similar Issues:

      Description

      I believe this bug affects any plugins, so I've marked it major. It seems be https://issues.jenkins-ci.org/browse/JENKINS-12514 but I'm not 100% sure so I didn't want to re-open.

      Basically, I'm unable to upgrade ssh-credentials-plugin. Because I use chef, this means chef tries and restarts Jenkins repeatedly, making the service unusable.

      Steps to reproduce:

      1. java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ list-plugins | grep ssh-credentials
        ssh-credentials SSH Credentials Plugin 1.10 (1.11)
      1. java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin http://updates.jenkins-ci.org/latest/ssh-credentials.hpi
        Installing a plugin from http://updates.jenkins-ci.org/latest/ssh-credentials.hpi
      1. java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ list-plugins | grep ssh-credentials
        ssh-credentials SSH Credentials Plugin 1.10 (1.11)
      1. service jenkins restart
      • Restarting Jenkins Continuous Integration Server jenkins [ OK ]
      1. java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ list-plugins | grep ssh-credentials
        ssh-credentials SSH Credentials Plugin 1.10 (1.11)

      (expected version 1.11).

      Other potentially useful information:

      1. find /var/lib/jenkins -type f -iname "ssh-credentials"
        /var/lib/jenkins/plugins/ssh-credentials.jpi
      1. cp /var/lib/jenkins/plugins/ssh-credentials.jpi /tmp/
      2. unzip /tmp/ssh-credentials.jpi
      1. grep -i version META-INF/MANIFEST.MF
        Manifest-Version: 1.0
        Archiver-Version: Plexus Archiver
        Implementation-Version: 1.10
        Compatible-Since-Version: 1.0
        Plugin-Version: 1.10
        Hudson-Version: 1.532.2
        Jenkins-Version: 1.532.2
      1. java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin http://updates.jenkins-ci.org/latest/ssh-credentials.hpi -deploy
        Installing a plugin from http://updates.jenkins-ci.org/latest/ssh-credentials.hpi
        java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:215)
        at java.util.zip.ZipFile.<init>(ZipFile.java:145)
        at java.util.jar.JarFile.<init>(JarFile.java:154)
        at java.util.jar.JarFile.<init>(JarFile.java:133)
        at hudson.ClassicPluginStrategy.getShortName(ClassicPluginStrategy.java:107)
        at hudson.PluginManager.dynamicLoad(PluginManager.java:439)
        at hudson.cli.InstallPluginCommand.run(InstallPluginCommand.java:105)
        at hudson.cli.CLICommand.main(CLICommand.java:237)
        at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:608)
        at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:583)
        at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:542)
        at hudson.remoting.UserRequest.perform(UserRequest.java:121)
        at hudson.remoting.UserRequest.perform(UserRequest.java:49)
        at hudson.remoting.Request$2.run(Request.java:326)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
        at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
        at hudson.remoting.CallableDecoratorAdapter.call(CallableDecoratorAdapter.java:18)
        at hudson.remoting.CallableDecoratorList$1.call(CallableDecoratorList.java:21)
        at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

      (Downloading and unzipping manually works great.)

        Attachments

          Issue Links

            Activity

            Hide
            danielbeck Daniel Beck added a comment - - edited

            This affects all plugins bundled with Jenkins because of a bug in InstallPluginCommand: It does not bother to determine whether the installed plugin is a bundled plugin and then create the pinned file (https://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins)

            Show
            danielbeck Daniel Beck added a comment - - edited This affects all plugins bundled with Jenkins because of a bug in InstallPluginCommand : It does not bother to determine whether the installed plugin is a bundled plugin and then create the pinned file ( https://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins )
            Hide
            danielbeck Daniel Beck added a comment -

            FWIW this issue is likely obsolete with the release of Jenkins 2.x and the related changes to the plugin model – can anyone confirm?

            Show
            danielbeck Daniel Beck added a comment - FWIW this issue is likely obsolete with the release of Jenkins 2.x and the related changes to the plugin model – can anyone confirm?
            Hide
            danielbeck Daniel Beck added a comment -

            No response in several months, so assuming this actually is obsolete has most of the bundled plugin functionality including 'Pinned Plugins' has been removed in 2.0

            Show
            danielbeck Daniel Beck added a comment - No response in several months, so assuming this actually is obsolete has most of the bundled plugin functionality including 'Pinned Plugins' has been removed in 2.0
            Hide
            waynr Wayne Warren added a comment -

            Daniel Beck I just ran into this on Jenkins 2.48.  I am working on docker-based integration tests for a plugin where I:

            • start up a docker container with Jenkins 2.48 installed, 
            • install all plugins used on my production jenkins instance on the docker container jenkins instance using jenkins-cli.jar (this includes a released version of the plugin I am working on)
            • then use jenkins-cli.jar to install a just-built snapshot version of the same plugin on the docker container jenkins instance

            This sequence of steps leads to the issue described here. I'll probably work around it by:

            • shutting down jenkins
            • removing the existing plugin from the plugins directory
            • starting jenkins

            This is acceptable for the current problem I am dealing with, but a different automated workflow such as using configuration management to manage a jenkins instance may not be able to tolerate a jenkins shutdown for the sake of upgrading a plugin. Although for all I know avoiding a shutdown may be altogether unavoidable in any case, but I thought it would be worth mentioning that I was able to reproduce this.

            Show
            waynr Wayne Warren added a comment - Daniel Beck I just ran into this on Jenkins 2.48.  I am working on docker-based integration tests for a plugin where I: start up a docker container with Jenkins 2.48 installed,  install all plugins used on my production jenkins instance on the docker container jenkins instance using jenkins-cli.jar (this includes a released version of the plugin I am working on) then use jenkins-cli.jar to install a just-built snapshot version of the same plugin on the docker container jenkins instance This sequence of steps leads to the issue described here. I'll probably work around it by: shutting down jenkins removing the existing plugin from the plugins directory starting jenkins This is acceptable for the current problem I am dealing with, but a different automated workflow such as using configuration management to manage a jenkins instance may not be able to tolerate a jenkins shutdown for the sake of upgrading a plugin. Although for all I know avoiding a shutdown may be altogether unavoidable in any case, but I thought it would be worth mentioning that I was able to reproduce this.
            Hide
            danielbeck Daniel Beck added a comment -

            a jenkins instance may not be able to tolerate a jenkins shutdown for the sake of upgrading a plugin

            This has nothing to do with this issue, and upgrading an already installed plugin using any method has always required a restart.

            Show
            danielbeck Daniel Beck added a comment - a jenkins instance may not be able to tolerate a jenkins shutdown for the sake of upgrading a plugin This has nothing to do with this issue, and upgrading an already installed plugin using any method has always required a restart.

              People

              • Assignee:
                danielbeck Daniel Beck
                Reporter:
                martinb3 Martin Smith
              • Votes:
                3 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: