grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.78k stars 950 forks source link

Problem run jenkins pipeline on kubernetes agents with snakeYaml 2.0 #13347

Closed AmmarRami closed 9 months ago

AmmarRami commented 9 months ago

Expected Behavior

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

Actual Behaviour

When I upgraded to jenkins version 2.401.3 running with java 11.0.21and 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 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 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 don't understand any groovy libraries and I have these errors:

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]

Can you help me to resolve this problem please?

Steps To Reproduce

No response

Environment Information

Example Application

Jenkins

Version

2.4.11

puneetbehl commented 9 months ago

Please use the recent version of Grails framework. We stopped supporting Grails 2. From the above log, it appears that the application is not able to resolve dependencies. It might be due to missing or wrong repositories.

I would recommend checking where the dependencies are located and cross-check it's coordinates and repositories.