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

Naginator plugin not really optional as it spews out a stacktrace when not installed

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • build-timeout-plugin
    • None
    • Jenkins 2.7

      If you install build timeout but not naginator, everytime you launch jenkins you see the stack trace below.

      This seems not a great way to treat an "optional" dependency. It should be non optional if it is going to do this, or some other approach needs to be used instead of just failing hard to load a component.

      WARNING: Failed to instantiate Key[type=hudson.plugins.build_timeout.operations.AbortAndRestartOperation$DescriptorImpl, annotation=[none]]; skipping this component
      com.google.inject.ProvisionException: Guice provision errors:
      
      1) Error injecting constructor, java.lang.NoClassDefFoundError: com/chikli/hudson/plugin/naginator/ScheduleDelay
        at hudson.plugins.build_timeout.operations.AbortAndRestartOperation$DescriptorImpl.<init>(AbortAndRestartOperation.java:120)
      
      1 error
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
      	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
      	at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
      	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
      	at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:1005)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1051)
      	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:1001)
      	at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)
      	at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)
      	at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:470)
      	at hudson.ExtensionList.load(ExtensionList.java:349)
      	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:287)
      	at hudson.ExtensionList.getComponents(ExtensionList.java:167)
      	at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:185)
      	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:287)
      	at hudson.ExtensionList.iterator(ExtensionList.java:156)
      	at hudson.ExtensionList.get(ExtensionList.java:147)
      	at com.cloudbees.jenkins.GitHubPushTrigger$DescriptorImpl.get(GitHubPushTrigger.java:320)
      	at org.jenkinsci.plugins.github.migration.Migrator.migrate(Migrator.java:41)
      	at org.jenkinsci.plugins.github.GitHubPlugin.postInitialize(GitHubPlugin.java:39)
      	at hudson.PluginManager$2$1$2.run(PluginManager.java:434)
      	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
      	at jenkins.model.Jenkins$7.runTask(Jenkins.java:996)
      

          [JENKINS-36696] Naginator plugin not really optional as it spews out a stacktrace when not installed

          ikedam added a comment -

          By the way, why JVM tries to load ScheduleDelay when initializing AbortAndRestartOperation$DescriptorImpl?
          It looks strange to me.

          ikedam added a comment - By the way, why JVM tries to load ScheduleDelay when initializing AbortAndRestartOperation$DescriptorImpl ? It looks strange to me.

          ikedam added a comment -

          I found it only displays the stacktrace, but doesn't cause fail to load build-timeout plugin.
          Changed the priority back to Major.

          ikedam added a comment - I found it only displays the stacktrace, but doesn't cause fail to load build-timeout plugin. Changed the priority back to Major.

          ikedam added a comment -

          ikedam added a comment - https://github.com/jenkinsci/build-timeout-plugin/pull/59

          ikedam added a comment -

          Released 1.17.1 with the fix for this.
          It will be available in the update center in a day.

          ikedam added a comment - Released 1.17.1 with the fix for this. It will be available in the update center in a day.

          Daniel Beck added a comment -

          michaelneale Can you confirm it's fixed?

          Daniel Beck added a comment - michaelneale Can you confirm it's fixed?

          Michael Neale added a comment -

          danielbeck yes it appears to be if I explicitly add it as a dep.

          We are not sure what brings this in as a transitive, but when we know, we can bump its dependency to use this.

          Michael Neale added a comment - danielbeck yes it appears to be if I explicitly add it as a dep. We are not sure what brings this in as a transitive, but when we know, we can bump its dependency to use this.

          Michael Neale added a comment -

          To be clear: yes this did fix the stack trace.

          Michael Neale added a comment - To be clear: yes this did fix the stack trace.

          Daniel Beck added a comment -

          It works for me on a pristine Jenkins home with 2.7.1 – the wizard pulls down build timeout 1.17.1.

          Try a standalone install, not a debug run.

          Daniel Beck added a comment - It works for me on a pristine Jenkins home with 2.7.1 – the wizard pulls down build timeout 1.17.1. Try a standalone install, not a debug run.

          Daniel Beck added a comment -

          Worked for me in 2.14 as well, so looks like it's likely an issue with your environment.

          Daniel Beck added a comment - Worked for me in 2.14 as well, so looks like it's likely an issue with your environment.

          Michael Neale added a comment -

          I cleaned everything out and it was fine.
          Sorry for the excitement.

          This looks great now, works great. dbeckham ikedam you are awesome - thanks for this!

          All good.

          Michael Neale added a comment - I cleaned everything out and it was fine. Sorry for the excitement. This looks great now, works great. dbeckham ikedam you are awesome - thanks for this! All good.

            ikedam ikedam
            michaelneale Michael Neale
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: