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

Problem with snakeyaml plugin when upgrade to 2.401.3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • snakeyaml-plugin
    • None
    • PROD

      Hello,

      When I run jenkins pipeline using a kubernetes agent, my pipeline create pod in the kubernetes namespace, attach this agent to master and use it to build, testing, deploying, etc
      To run pod in kubernetes my sharedlib use snakeYaml version 1.25 to merge yamls and generate global yaml script of pod.
      With jenkins 2.387.1 and kubernetes plugin version 3896.v19b_160fd9589 this work very well

      When I upgraded to jenkins version 2.401.3 running with java 11.0.21and upgraded all plugins to last version (snakeyaml 2.2) I am not able to launch kubernetes agent. My agent is a pod created via a yaml stream. This yaml stream il maked with MargeYaml groovy script wich use snakeYaml version 1.25.

      When he launch agent I have this error: java.lang.NullPointerException: LoaderOptions must be provided
      When I see the tag 1.25 of the groovy library I constat that the constructor SafeConstructor don't have LoaderOptions instance param.

      So I upgraded my binaries groovy to 4.0.0 tu upgrade Grails to 4.0. And I upgraded my grappe dependencies snakeYaml to 1.28 in my yaml file:

      @Grab(group='org.yaml', module='snakeyaml', version='1.28')
      

      but my groovy bin don't understand any groovy libraries and I have these errors:

      2024-01-15_16-46-41 org.jenkinsci.plugins.workflow.cps.CpsCompilationErrorsException: startup failed: 
      2024-01-15_16-46-41 General error during conversion: Error grabbing Grapes -- [unresolved dependency: org.apache.commons#commons-lang4;4.0: not found] 
      2024-01-15_16-46-41 
      2024-01-15_16-46-41 java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.apache.commons#commons-lang4;4.0: not found|#commons-lang4;4.0: not found]
      

      I verified in my jenkins home folder /var/lib/jenkins/.groovy/grapes/org.apache.commons/ and I have only the 3 version witch don't work after upgrade:

      ls -ltra /var/lib/jenkins/.groovy/grapes/org.apache.commons/
      total 4
      drwxr-xr-x. 4 jenkins jenkins   47 Apr 24  2020 .
      drwxr-xr-x. 2 jenkins jenkins   77 Jan 15 15:11 commons-parent
      drwxr-xr-x. 3 jenkins jenkins   91 Jan 15 15:33 commons-lang3
      drwxr-xr-x. 7 jenkins jenkins 4096 Jan 15 16:46 ..
      

      In the /var/lib/jenkins/.groovy/grapes/org.yaml also I have only the old versions 1.25 and 1.26 of snakeyaml:

      ls -ltra /var/lib/jenkins/.groovy/grapes/org.yaml/snakeyaml/
      total 108
      -rw-r--r--. 1 jenkins jenkins 37711 Nov 19  2019 ivy-1.25.xml.original
      -rw-r--r--. 1 jenkins jenkins  5247 Nov 19  2019 ivy-1.25.xml
      -rw-r--r--. 1 jenkins jenkins 37848 Aug 18  2020 ivy-1.26.xml.original
      -rw-r--r--. 1 jenkins jenkins  5248 Aug 18  2020 ivy-1.26.xml
      drwxr-xr-x. 3 jenkins jenkins    22 Jun  1  2022 ..
      drwxr-xr-x. 3 jenkins jenkins  4096 Jan 11 18:12 .
      -rw-r--r--. 1 jenkins jenkins   817 Jan 11 18:12 ivydata-1.26.properties
      drwxr-xr-x. 2 jenkins jenkins    61 Jan 11 18:12 jars
      -rw-r--r--. 1 jenkins jenkins   137 Jan 15 11:33 ivydata-1.25.properties
      

      Can you explain to me how I can update these groovy dependencies to enable my updated jenkins version to launch kubernetes agents like the  2.387.1 version?

       

      Thank's a lot

            escoem Emilio Escobar
            ramim Rami Ammar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: