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

Enable disabled (transitive) dependencies when installing a new plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      When installing a new plugin, Jenkins automatically also installs dependencies that are not installed.

      Unfortunately, it's possible to disable plugins, whose effect to the Jenkins runtime is effectively the same as if the plugin was missing – except that there's currently no process to enable plugins that are disabled.

      Similar to DownloadJobs added for missing dependencies, there should be EnableJobs that enable disabled dependencies (or another approach, but this would nicely mirror the existing DownloadJob one).

      We received multiple reports from users affected by this when upgrading to 2.0 and installing the pipeline plugins, so this is critical.

        Attachments

          Issue Links

            Activity

            Show
            danielbeck Daniel Beck added a comment - References: https://issues.jenkins-ci.org/browse/JENKINS-34434 https://groups.google.com/forum/#!msg/jenkinsci-users/4mAzgV_HvCk/XRk-uLdUNAAJ https://www.reddit.com/r/programming/comments/4gl6cd/jenkins_20_is_here/d2ip3cy https://www.reddit.com/r/programming/comments/4gl6cd/jenkins_20_is_here/d2jpm52
            Show
            danielbeck Daniel Beck added a comment - https://twitter.com/alexsotob/status/725425301522661376
            Hide
            kzantow Keith Zantow added a comment -

            Similarly, if plugin installations are not run, will detached plugins will get installed? I just thought of this as I'm looking to detach some code into a plugin for another ticket... this would leave Jenkins in a similarly bad state. As part of this PR, I think we should ensure during an upgrade, at least:

            *) required dependencies are installed
            *) required dependencies are enabled

            Show
            kzantow Keith Zantow added a comment - Similarly, if plugin installations are not run, will detached plugins will get installed? I just thought of this as I'm looking to detach some code into a plugin for another ticket... this would leave Jenkins in a similarly bad state. As part of this PR, I think we should ensure during an upgrade, at least: *) required dependencies are installed *) required dependencies are enabled
            Hide
            danielbeck Daniel Beck added a comment -

            if plugin installations are not run, will detached plugins will get installed

            That code exists, executed during startup. It compares old Jenkins version with new Jenkins version, and installs all plugins in the "bundled" version if they've been detached between these versions.

            Show
            danielbeck Daniel Beck added a comment - if plugin installations are not run, will detached plugins will get installed That code exists, executed during startup. It compares old Jenkins version with new Jenkins version, and installs all plugins in the "bundled" version if they've been detached between these versions.
            Hide
            danielbeck Daniel Beck added a comment -

            Sam Van Oort confirmed after some investigation that it appears that multiple reports about Jenkins failing to start are all caused by plugins being disabled, and possibly users not properly deleting the *.disabled files.

            Show
            danielbeck Daniel Beck added a comment - Sam Van Oort confirmed after some investigation that it appears that multiple reports about Jenkins failing to start are all caused by plugins being disabled, and possibly users not properly deleting the *.disabled files.
            Hide
            danielbeck Daniel Beck added a comment - - edited

            Steps to reproduce:

            • Install 1.653
            • Create a freestyle job
            • Update all plugins
            • Restart
            • Disable Subversion and SCM API plugin
            • Shut down
            • Start 2.0 on same Jenkins home
            • 'Finish upgrade'
            • (GHOF and Pipeline:Groovy will fail to load)
            • Restart

            Result:

            hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
            	at hudson.WebAppMain$3.run(WebAppMain.java:237)
            Caused by: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
            	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
            	at jenkins.InitReactorRunner.run(InitReactorRunner.java:44)
            	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1020)
            	at jenkins.model.Jenkins.<init>(Jenkins.java:864)
            	at hudson.model.Hudson.<init>(Hudson.java:85)
            	at hudson.model.Hudson.<init>(Hudson.java:81)
            	at hudson.WebAppMain$3.run(WebAppMain.java:225)
            Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
            	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
            	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
            	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
            	at jenkins.model.Jenkins$8.runTask(Jenkins.java:1009)
            	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
            	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
            	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:744)
            Caused by: java.lang.reflect.InvocationTargetException
            	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.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
            	... 8 more
            Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
            	at java.util.ArrayList.rangeCheck(ArrayList.java:635)
            	at java.util.ArrayList.get(ArrayList.java:411)
            	at hudson.ExtensionList.get(ExtensionList.java:171)
            	at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:1690)
            	at hudson.maven.PluginImpl.init(PluginImpl.java:58)
            	... 13 more
            Show
            danielbeck Daniel Beck added a comment - - edited Steps to reproduce: Install 1.653 Create a freestyle job Update all plugins Restart Disable Subversion and SCM API plugin Shut down Start 2.0 on same Jenkins home 'Finish upgrade' (GHOF and Pipeline:Groovy will fail to load) Restart Result: hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException at hudson.WebAppMain$3.run(WebAppMain.java:237) Caused by: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269) at jenkins.InitReactorRunner.run(InitReactorRunner.java:44) at jenkins.model.Jenkins.executeReactor(Jenkins.java:1020) at jenkins.model.Jenkins.<init>(Jenkins.java:864) at hudson.model.Hudson.<init>(Hudson.java:85) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.WebAppMain$3.run(WebAppMain.java:225) Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at jenkins.model.Jenkins$8.runTask(Jenkins.java:1009) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) 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:744) Caused by: java.lang.reflect.InvocationTargetException 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.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104) ... 8 more Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:635) at java.util.ArrayList.get(ArrayList.java:411) at hudson.ExtensionList.get(ExtensionList.java:171) at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:1690) at hudson.maven.PluginImpl.init(PluginImpl.java:58) ... 13 more
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: kzantow
            Path:
            core/src/main/java/hudson/model/UpdateCenter.java
            core/src/main/java/hudson/model/UpdateSite.java
            core/src/main/resources/hudson/model/UpdateCenter/EnableJob/row.jelly
            core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row.jelly
            http://jenkins-ci.org/commit/jenkins/247abf734d46c5cf7a5a5fba333d9824dc7d8c3e
            Log:
            JENKINS-34494 - enable required plugins during plugin installs

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: kzantow Path: core/src/main/java/hudson/model/UpdateCenter.java core/src/main/java/hudson/model/UpdateSite.java core/src/main/resources/hudson/model/UpdateCenter/EnableJob/row.jelly core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row.jelly http://jenkins-ci.org/commit/jenkins/247abf734d46c5cf7a5a5fba333d9824dc7d8c3e Log: JENKINS-34494 - enable required plugins during plugin installs
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/main/java/hudson/PluginManager.java
            core/src/main/java/hudson/model/UpdateCenter.java
            core/src/main/java/hudson/model/UpdateSite.java
            core/src/main/resources/hudson/model/UpdateCenter/EnableJob/row.jelly
            core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row.jelly
            http://jenkins-ci.org/commit/jenkins/3ac7ee93072d878804491d7816c2d7fbd8bee64f
            Log:
            Merge pull request #2299 from kzantow/JENKINS-34494-enable-required-plugins

            JENKINS-34494 enable required plugins during plugin installs

            Compare: https://github.com/jenkinsci/jenkins/compare/59f066462ce1...3ac7ee93072d

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/PluginManager.java core/src/main/java/hudson/model/UpdateCenter.java core/src/main/java/hudson/model/UpdateSite.java core/src/main/resources/hudson/model/UpdateCenter/EnableJob/row.jelly core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row.jelly http://jenkins-ci.org/commit/jenkins/3ac7ee93072d878804491d7816c2d7fbd8bee64f Log: Merge pull request #2299 from kzantow/ JENKINS-34494 -enable-required-plugins JENKINS-34494 enable required plugins during plugin installs Compare: https://github.com/jenkinsci/jenkins/compare/59f066462ce1...3ac7ee93072d

              People

              • Assignee:
                kzantow Keith Zantow
                Reporter:
                danielbeck Daniel Beck
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: