Problem with snakeyaml plugin when upgrade to 2.401.3

Jenkins setup:

Jenkins: 2.401.3
OS: Linux - 3.10.0-1160.90.1.el7.x86_64
Java: 11.0.19 - Red Hat, Inc. (OpenJDK 64-Bit Server VM)
---
Office-365-Connector:4.18.0
Parameterized-Remote-Trigger:3.1.6.3
analysis-model-api:11.0.0
ansible:148.v6b_13c6de3a_47
ansicolor:1.0.2
ant:481.v7b_09e538fcca
antisamy-markup-formatter:159.v25b_c67cd35fb_
apache-httpcomponents-client-4-api:4.5.14-150.v7a_b_9d17134a_5
audit-trail:333.vb_e1b_b_0f1238c
authentication-tokens:1.4
aws-bucket-credentials:1.0.0
aws-java-sdk:1.12.406-370.v8f993c987059
aws-java-sdk-cloudformation:1.12.406-370.v8f993c987059
aws-java-sdk-codebuild:1.12.406-370.v8f993c987059
aws-java-sdk-ec2:1.12.406-370.v8f993c987059
aws-java-sdk-ecr:1.12.406-370.v8f993c987059
aws-java-sdk-ecs:1.12.406-370.v8f993c987059
aws-java-sdk-efs:1.12.406-370.v8f993c987059
aws-java-sdk-elasticbeanstalk:1.12.406-370.v8f993c987059
aws-java-sdk-iam:1.12.406-370.v8f993c987059
aws-java-sdk-logs:1.12.406-370.v8f993c987059
aws-java-sdk-minimal:1.12.406-370.v8f993c987059
aws-java-sdk-sns:1.12.406-370.v8f993c987059
aws-java-sdk-sqs:1.12.406-370.v8f993c987059
aws-java-sdk-ssm:1.12.406-370.v8f993c987059
azure-ad:336.vd05b_01358644
azure-sdk:118.v43f74dd9ca_dc
badge:1.9.1
bootstrap4-api:4.6.0-5
bootstrap5-api:5.2.2-1
bouncycastle-api:2.27
branch-api:2.1071.v1a_188a_562481
build-monitor-plugin:1.14-653.va_1c684a_30b_ff
build-pipeline-plugin:1.5.8
build-timeout:1.28
build-timestamp:1.0.3
build-with-parameters:76.v9382db_f78962
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
change-assembly-version-plugin:1.10
checks-api:2.0.0
chromedriver:1.2
cloudbees-folder:6.815.v0dd5a_cb_40e0e
cobertura:1.17
code-coverage-api:4.0.0
codebeamer-xunit-importer:1.9
codebeamer-xunit-uploader:1.1.4
codesonar:3.2.1
command-launcher:90.v669d7ccb_7c31
commons-httpclient3-api:3.1-3
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-36.vc008c8fcda_7b_
conditional-buildstep:1.4.2
config-file-provider:3.11.1
configuration-as-code:1569.vb_72405b_80249
copyartifact:686.v6fd37018d7c2
credentials:1224.vc23ca_a_9a_2cb_0
credentials-binding:523.vd859a_4b_122e6
cucumber-living-documentation:3.2
cucumber-perf:2.0.9
cucumber-reports:5.7.5
cucumber-testresult-plugin:0.10.1
cucumber-trends-report:1.3
cvs:2.19.1
data-tables-api:1.13.3-2
depgraph-view:1.0.5
display-url-api:2.3.7
docker-commons:419.v8e3cd84ef49c
docker-java-api:3.2.13-68.va_875df25a_b_45
docker-plugin:1.3.0
docker-workflow:563.vd5d2e5c4007f
dtkit-api:3.0.2
durable-task:504.vb10d1ae5ba2f
echarts-api:5.4.0-2
email-ext:2.95
embeddable-build-status:339.v1edb_5e63da_45
envinject:2.901.v0038b_6471582
envinject-api:1.199.v3ce31253ed13
environment-variable-page-decoration:1.3.0
extended-choice-parameter:359.v35dcfdd0c20d
extended-read-permission:3.2
extensible-choice-parameter:1.8.0
external-monitor-job:203.v683c09d993b_9
favorite:2.4.1
file-parameters:285.v757c5b_67a_c25
font-awesome-api:6.3.0-1
forensics-api:2.0.1
fxcop-runner:1.1
gatling:1.3.0
git:5.0.0
git-client:4.1.0
git-parameter:0.9.18
git-server:99.va_0826a_b_cdfa_d
gitlab-api:5.0.1-78.v47a_45b_9f78b_7
gitlab-logo:1.1.0
gitlab-merge-request-jenkins:2.0.0
gitlab-plugin:1.7.8
gradle:2.8
greenballs:1.15.1
groovy:453.vcdb_a_c5c99890
groovy-postbuild:2.5
h2-api:1.4.199
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
harbor-plugin:1.1
htmlpublisher:1.31
http-post:1.2
http_request:1.16
instance-identity:142.v04572ca_5b_265
ionicons-api:31.v4757b_6987003
jackson2-api:2.14.2-319.v37853346a_229
jacoco:3.3.2
jakarta-activation-api:2.0.1-3
jakarta-mail-api:2.0.1-3
javadoc:226.v71211feb_e7e9
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.8-1
jdepend:1.3.1
jdk-tool:63.v62d2fd4b_4793
jersey2-api:2.38-1
jira:3.9
jjwt-api:0.11.5-77.v646c772fddb_0
jobConfigHistory:1207.vd28a_54732f92
jquery:1.12.4-1
jquery3-api:3.6.3-1
jsch:0.1.55.61.va_e9ee26616e7
jsunit:1.6
junit:1177.v90374a_ef4d09
kubernetes:3896.v19b_160fd9589
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9
kubernetes-credentials:0.10.0
last-changes:2.7.11
locale:226.v008e1b_58cb_b_0
m2release:0.16.3
mailer:448.v5b_97805e3767
managed-scripts:1.5.6
mapdb-api:1.0.9-28.vf251ce40855d
matrix-auth:3.1.6
matrix-combinations-parameter:1.3.2
matrix-project:785.v06b_7f47b_c631
maven-artifact-choicelistprovider:1.11.0
maven-invoker-plugin:2.5
maven-metadata-plugin:2.2
maven-plugin:3.21
metadata:1.1.0b
metrics:4.2.13-420.vea_2f17932dd6
mina-sshd-api-common:2.9.2-50.va_0e1f42659a_a
mina-sshd-api-core:2.9.2-50.va_0e1f42659a_a
msbuild:1.30
mstestrunner:1.5.0
nested-view:1.28
next-build-number:1.8
nexus-jenkins-plugin:3.16.481.ved9f5106e132
nodejs:1.6.0
nodelabelparameter:1.11.0
nuget:1.1
okhttp-api:4.10.0-132.v7a_7b_91cef39c
pam-auth:1.10
parameter-separator:1.3
parameterized-scheduler:1.2
parameterized-trigger:2.45
permissive-script-security:0.7
pipeline-build-step:486.vd08f550cceee
pipeline-graph-analysis:202.va_d268e64deb_3
pipeline-groovy-lib:629.vb_5627b_ee2104
pipeline-input-step:466.v6d0a_5df34f81
pipeline-maven:1279.v5d711113020f
pipeline-milestone-step:111.v449306f708b_7
pipeline-model-api:2.2118.v31fd5b_9944b_5
pipeline-model-definition:2.2118.v31fd5b_9944b_5
pipeline-model-extensions:2.2118.v31fd5b_9944b_5
pipeline-multibranch-defaults:2.1
pipeline-rest-api:2.31
pipeline-stage-step:305.ve96d0205c1c6
pipeline-stage-tags-metadata:2.2118.v31fd5b_9944b_5
pipeline-stage-view:2.31
pipeline-utility-steps:2.15.1
pitmutation:1.0-18
plain-credentials:143.v1b_df8b_d3b_e48
plugin-util-api:3.1.0
popper-api:1.16.1-3
popper2-api:2.11.6-2
postbuild-task:1.9
postbuildscript:3.2.0-460.va_fda_0fa_26720
powershell:2.0
prism-api:1.29.0-3
publish-over:0.22
pubsub-light:1.17
python:1.3
rebuild:1.34
repository-connector:2.2.0
resource-disposer:0.21
role-strategy:587.v2872c41fa_e51
run-condition:1.5
run-condition-extras:0.3
scm-api:631.v9143df5b_e4a_a
script-security:1229.v4880b_b_e905a_6
selenium:3.141.59
selenium-aes:0.5
seleniumhtmlreport:1.1
simple-theme-plugin:146.v0e67db_a_9052e
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4
sonar:2.15
sqlplus-script-runner:2.0.21
sse-gateway:1.26
ssh:2.6.1
ssh-agent:327.v230ecd01f86f
ssh-credentials:305.v8f4381501156
ssh-slaves:2.877.v365f5eb_a_b_eec
ssh-steps:2.0.65.vd26b_5b_9b_de4d
sshd:3.275.v9e17c10f2571
structs:324.va_f5d6774f3a_d
subversion:2.17.1
testcomplete-xunit:1.1
testcomplete11-xunit:1.1
thinBackup:1.15
timestamper:1.22
token-macro:321.vd7cc1f2a_52c8
trilead-api:2.84.v72119de229b_7
uno-choice:2.6.4
variant:59.vf075fe829ccb
warnings-ng:10.0.2
windows-exe-runner:35.vea_7d292d39a_2
winrm-client:1.0
workflow-aggregator:596.v8c21c963d92d
workflow-api:1208.v0cc7c6e0da_9e
workflow-basic-steps:1010.vf7a_b_98e847c1
workflow-cps:3641.vf58904a_b_b_5d8
workflow-cps-global-lib:609.vd95673f149b_b
workflow-cps-global-lib-http:2.23.0
workflow-durable-task-step:1234.v019404b_3832a
workflow-job:1284.v2fe8ed4573d4
workflow-multibranch:733.v109046189126
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5c
ws-cleanup:0.44
xray-connector:2.6.1
xunit:3.1.2
xvfb:1.2

When I run jenkins pipeline using a kubernetes agent, my pipeline create pod in the kubernetes namespace, attach this agent to controller 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?

I have installed exactly what is requested by the workarround of isse JENKINS-71966 but this don’t work for me. I have the same problem and in my jenkins log I see this error:

][INFO ][org.jenkinsci.plugins.workflow.support.concurrent.Timeout lambda$ping$0] Running CpsFlowExecutionOwner[PIPELINE_VALIDATION_BACK/1883:PIPELINE_VALIDATION_BACK #1883] unresponsive for 7 min 45 sec

It’s like it not able to dowload some groovy dependencies.

Can you tell me please witch groovy version I should youse with jenkins 2.401.3 and kubernetes plugin 4029.v5712230ccb_f8?

Thank’s

Ce problème a été résolu par des modifications apportées dans notre sharedlib