Our groovie pipelines fail immediately update from Jenkins 2.361.4 to Jenkins 2.387.3

Kind community,

We are upgrading to the new LTS from Jenkins 2.361.4 to Jenkins 2.387.3.

After upgrading the core version, our groovie pipelines fail with the following error, before any step in the pipeline:

java.lang.NoSuchMethodError: 'boolean org.kohsuke.groovy.sandbox.SandboxTransformer.mightBePositionalArgumentConstructor(org.codehaus.groovy.ast.expr.VariableExpression)'
at com.cloudbees.groovy.cps.SandboxCpsTransformer.visitAssignmentOrCast(SandboxCpsTransformer.java:93)
at com.cloudbees.groovy.cps.CpsTransformer$42.run(CpsTransformer.java:1171)
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.java:446)
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.java:409)
at com.cloudbees.groovy.cps.CpsTransformer.visitDeclarationExpression(CpsTransformer.java:1164)
at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:357)
at com.cloudbees.groovy.cps.CpsTransformer.visitExpressionStatement(CpsTransformer.java:589)
at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:357)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:363)
at com.cloudbees.groovy.cps.CpsTransformer$5.run(CpsTransformer.java:515)
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.java:446)
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.java:409)
at com.cloudbees.groovy.cps.CpsTransformer.visitBlockStatement(CpsTransformer.java:512)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:357)
at com.cloudbees.groovy.cps.CpsTransformer$2.run(CpsTransformer.java:388)
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.java:446)
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.java:409)
at com.cloudbees.groovy.cps.CpsTransformer.visitWithSafepoint(CpsTransformer.java:374)
at com.cloudbees.groovy.cps.CpsTransformer.visitMethod(CpsTransformer.java:231)
at com.cloudbees.groovy.cps.SandboxCpsTransformer.visitMethod(SandboxCpsTransformer.java:73)
at com.cloudbees.groovy.cps.CpsTransformer.call(CpsTransformer.java:136)
at com.cloudbees.groovy.cps.SandboxCpsTransformer.call(SandboxCpsTransformer.java:29)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:553)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:505)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:336)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)

Upon research, we found that the cause is two plugins: Script Security (1229.v4880b_b_e905a_6) and Pipeline: Groovy (2689.v434009a_31b_f1).

In fact, after updating them simultaneously, as per the release notes for Script Security 1184.v85d16b_d851b_3, to the latest versions Script Security (1244.ve463715a_f89c) and Pipeline: Groovy (3659.v582dc37621d8) the error is no longer there.

At this point, another error occurs, before any step in the pipeline:

java.lang.NoClassDefFoundError: Could not initialize class org.jenkinsci.plugins.workflow.cps.SandboxContinuable
at org.jenkinsci.plugins.workflow.cps.CpsThread.<init>(CpsThread.java:122)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.addThread(CpsThreadGroup.java:215)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$1.run(CpsFlowExecution.java:546)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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)

Regarding this one, we could not find references to resolve and pipelines fail immediately after startup, even with simple echo steps in Declarative Pipeline.

Has anyone ever had this problem or can give us more information?

Thanks in advance for any help!
Marco.

Hello @mb77 and welcome to this community :wave:

How did you update the plugins? Via the Jenkins UI, or by downloading and installing the plugins by yourself?

Are you sure these two updated plugins are compatible with your version of Jenkins?

Hello,

We upgraded the plugins with the UI, as we always did in the past without any problem. The upgrade seems to finish properly and the version installed is displayed correctly in the installed plugins tab.

The plugins don’t show any warning regarding the compatibility with the latest LTS, by the way exploring the detailed version information for both of them, Script Security and Pipeline: Groovy, the rows for Jenkins version 2.387.3 are missing.
Unfortunately, it is not explicit if it is an incompatibility issue or something else.

Thanks for the support.
Marco.

1 Like