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

Blue ocean and kubernetes stack trace with Jenkins 2.387.3 and snakeyaml 2.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None

      When I install the suggested plugins from the Jenkins 2.387.3 setup wizard and then install the blue ocean plugin, Jenkins reports a stack trace on startup. The stack trace is:

      2023-09-05 00:56:56.020+0000 [id=35]    WARNING hudson.ExtensionFinder$Sezpoz#scout: Failed to scout io.jenkins.blueocean.service.embedded.analytics.BrowserAndOperatingSystemAnalyticsProperties
      java.lang.NoSuchMethodError: org.yaml.snakeyaml.constructor.SafeConstructor: method 'void <init>()' not found
              at ua_parser.Parser.initialize(Parser.java:80)
              at ua_parser.Parser.<init>(Parser.java:45)
              at io.jenkins.blueocean.service.embedded.analytics.BrowserAndOperatingSystemAnalyticsProperties.<clinit>(BrowserAndOperatingSystemAnalyticsProperties.java:19)
              at java.base/java.lang.Class.forName0(Native Method)
              at java.base/java.lang.Class.forName(Class.java:398)
              at hudson.ExtensionFinder$Sezpoz.scout(ExtensionFinder.java:769)
              at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:353)
              at hudson.ExtensionList.load(ExtensionList.java:384)
              at hudson.ExtensionList.ensureLoaded(ExtensionList.java:320)
              at hudson.ExtensionList.getComponents(ExtensionList.java:184)
              at jenkins.model.Jenkins$6.onInitMilestoneAttained(Jenkins.java:1196)
              at jenkins.InitReactorRunner$1.onAttained(InitReactorRunner.java:88)
              at org.jvnet.hudson.reactor.ReactorListener$Aggregator.lambda$onAttained$3(ReactorListener.java:108)
              at org.jvnet.hudson.reactor.ReactorListener$Aggregator.run(ReactorListener.java:116)
              at org.jvnet.hudson.reactor.ReactorListener$Aggregator.onAttained(ReactorListener.java:108)
              at org.jvnet.hudson.reactor.Reactor$1.run(Reactor.java:182)at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120)
              at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
              at java.base/java.lang.Thread.run(Thread.java:829)
      

      A stack trace is expected from the kubernetes 4007.v633279962016 plugin when installed with Jenkins 2.387.3 and snakeyaml api plugin 2.2-111.vc6598e30cc65. I've not been able to create a scenario with the kubernetes plugin, but the automated tests show the following stack trace:

      java.lang.NoSuchMethodError: org.yaml.snakeyaml.constructor.SafeConstructor: method 'void <init>()' not found
      	at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:256)
      	at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:387)
      	at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:353)
      	at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:337)
      	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.unmarshal(OperationSupport.java:753)
      	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.load(BaseOperation.java:261)
      	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.load(BaseOperation.java:93)
      	at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.parseFromYaml(PodTemplateUtils.java:610)
      	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
      	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
      	at org.csanchez.jenkins.plugins.kubernetes.pod.yaml.Merge.merge(Merge.java:25)
      	at org.csanchez.jenkins.plugins.kubernetes.PodTemplate.getYamlsPod(PodTemplate.java:201)
      	at org.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder.build(PodTemplateBuilder.java:297)
      	at org.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilderTest.yamlOverrideSecurityContext(PodTemplateBuilderTest.java:817)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.mockito.internal.junit.JUnitSessionStore$1.evaluateSafely(JUnitSessionStore.java:55)
      	at org.mockito.internal.junit.JUnitSessionStore$1.evaluate(JUnitSessionStore.java:43)
      	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:607)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      

      Workarounds

      The issue can be avoided by choosing to not upgrade the snakeyaml plugin to 2.2.

      The issue can also be avoided by upgrading from Jenkins 2.387.3 to Jenkins 2.401.3 or Jenkins 2.414.1 and upgrading the blue ocean plugins. An updated blue ocean plugin (1.27.6) is available for Jenkins 2.401.3 with support for snakeyaml 2.2

      History

      This failure was originally detected in the Jenkins plugin bill of materials as part of a full test.

      Steps to duplicate the issue:

      1. Create a plugins.txt with the list of plugin versions to be installed
      2. Create a run-jenkins.sh shell script to download Jenkins 2.387.3 and the plugins
      3. Run the run-jenkins.sh shell script
      4. Complete the setup wizard by creating a user and choosing to install no additional plugins
      5. Confirm that the stack trace is not visible in the Jenkins console output
      6. Use the plugin manager page to upgrade the snakeyaml plugin to snakeyaml 2.2
      7. Restart Jenkins and confirm that the stack trace is now reported as listed above

            escoem Emilio Escobar
            markewaite Mark Waite
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: