Problem run jenkins pipeline on kubernetes agents with snakeYaml 2.0

119 views Asked by At

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

When I 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 doesn't have LoaderOptions instance param. So, I upgraded my grappe dependencies snakeYaml to 2.0 in my yaml file: https://github.com/grab(group='org.yaml', module='snakeyaml', version='2.0') but my groovy bin doesn't understand any groovy libraries and I have these errors:

2024-01-11_11-21-24 Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: d6252710-3d31-488c-b7c0-6839ef4acc0f 2024-01-11_11-21-24 org.jenkinsci.plugins.workflow.cps.CpsCompilationErrorsException: startup failed: 2024-01-11_11-21-24 General error during conversion: Error grabbing Grapes -- [unresolved dependency: org.yaml#snakeyaml;2.0: not found, unresolved dependency: org.apache.commons#commons-lang3;3.14.0: not found, unresolved dependency: org.postgresql#postgresql;42.3.1: not found, unresolved dependency: org.apache.commons#commons-lang3;3.6: not found] 2024-01-11_11-21-24 2024-01-11_11-21-24 java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.yaml#snakeyaml;2.0: not found, unresolved dependency: org.apache.commons#commons-lang3;3.14.0: not found, unresolved dependency: org.postgresql#postgresql;42.3.1: not found, unresolved dependency: org.apache.commons#commons-lang3;3.6: not found]

With jenkins 2.387.1 and kubernetes plugin version 3896.v19b_160fd9589 this works very well

Can you help me to resolve this problem please?

0

There are 0 answers