Scripted pipeline aborts for unknown reasons

116 views
Skip to first unread message

Markus "Shorty" Uckelmann

unread,
Aug 9, 2018, 11:28:44 AM8/9/18
to Jenkins Users
Hello all,

My Jenkinsfile aborts with an error and I can't find the reason. I ran
out of ideas. Also I have no clue what the error means (neither Java nor
Groovy is my strength). The curious thing is, when I remove the last
block ("Clean") in the runPipeline function the job runs successfully.

Please let me know if more information is needed.

Any help would be much appreciated.


First line of the error is:

hudson.remoting.ProxyException:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot
cast object '{clean-composer=null, clean-qucli=null}' with class
'java.util.HashMap' to class
'org.jenkinsci.plugins.pipeline.modeldefinition.model.Root' due to:
groovy.lang.GroovyRuntimeException: Could not find matching constructor
for:
org.jenkinsci.plugins.pipeline.modeldefinition.model.Root(java.util.HashMap)


Jenkinsfile:
https://gist.github.com/bemeyert/3f88cc0c458d9d8c2dc5e853fdf4e7b4#file-jenkinsfile-groovy

Complete error:
https://gist.github.com/bemeyert/3f88cc0c458d9d8c2dc5e853fdf4e7b4#file-jenkins-error


Cheers, Shorty

Björn Pedersen

unread,
Aug 10, 2018, 7:34:16 AM8/10/18
to Jenkins Users
Hi,

I think you  are trying to be too clever here:
pipeline{ } expects a declarative pipeline, but you are supplying a scripted one inside.
The error mentions
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(jar:file:/data/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:59)
at WorkflowScript.runPipeline(WorkflowScript:23)   <- this is  the line in your script where the error happens.
at WorkflowScript.run(WorkflowScript:10)

Try to get it working without  'pipeline {} '

Björn

Markus "Shorty" Uckelmann

unread,
Aug 10, 2018, 9:07:57 AM8/10/18
to jenkins...@googlegroups.com
On 8/10/18 1:34 PM, 'Björn Pedersen' via Jenkins Users wrote:
> Hi,

Hola Björn,

> I think you  are trying to be too clever here:

HaHa, would I ask this if I was clever? ;)

> pipeline{ } expects a declarative pipeline, but you are supplying a
> scripted one inside.

Brilliant, I should have known that.

> The error mentions
[...]
> at WorkflowScript.runPipeline(WorkflowScript:23)   <- this is  the line
> in your script where the error happens.
[...]
Thanks for pointing that out. Still can't read Java stack traces...

> Try to get it working without  'pipeline {} '

Done and done. It works!

Many, many thanks, Björn. You saved me from going insane.

Cheers, Shorty
Reply all
Reply to author
Forward
0 new messages